tcore
aul
appsvc
+ capi-appfw-app-manager
security-server
- pkgmgr
)
FOREACH(flag ${pkgs_CFLAGS})
#ADD_DEFINITIONS("-DTIZEN_USE_DESKTOP_FILE")
#ADD_DEFINITIONS("-DTIZEN_SUPPORT_SAT_ICON")
-IF (BOARD_PLATFORM_SPREADTRUM)
-ADD_DEFINITIONS("-DTIZEN_PLATFORM_LITE")
-ELSE()
+IF (BOARD_PLATFORM_QCOM)
ADD_DEFINITIONS("-DTIZEN_PLATFORM_USE_QCOM_QMI")
-ENDIF (BOARD_PLATFORM_SPREADTRUM)
+ENDIF (BOARD_PLATFORM_QCOM)
MESSAGE(${CMAKE_C_FLAGS})
MESSAGE(${pkgs_LDFLAGS})
SET(SRCS
- src/desc-dbus.c
- src/common.c
- src/network.c
- src/phonebook.c
- src/sim.c
- src/sap.c
- src/sms.c
- src/sat.c
- src/sat_manager.c
- src/sat_ui_support/sat_ui_support.c
- src/ss.c
- src/call.c
- src/modem.c
- src/gps.c
- src/oem.c
+ src/desc-dtapi.c
+ src/dtapi_main.c
+ src/dtapi_common.c
+ src/dtapi_network.c
+ src/dtapi_phonebook.c
+ src/dtapi_sim.c
+ src/dtapi_sap.c
+ src/dtapi_sms.c
+ src/dtapi_sat.c
+ src/dtapi_sat_manager.c
+ src/sat_ui_support/sat_ui_support.c
+ src/dtapi_ss.c
+ src/dtapi_call.c
+ src/dtapi_modem.c
+ src/dtapi_oem.c
)
ADD_CUSTOM_COMMAND(
${INTROSPECTION}/call.xml
${INTROSPECTION}/ss.xml
${INTROSPECTION}/modem.xml
- ${INTROSPECTION}/gps.xml
${INTROSPECTION}/oem.xml
COMMENT "Generating GDBus .c/.h")
-Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.\r
-\r
- Apache License\r
- Version 2.0, January 2004\r
- http://www.apache.org/licenses/\r
-\r
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\r
-\r
- 1. Definitions.\r
-\r
- "License" shall mean the terms and conditions for use, reproduction,\r
- and distribution as defined by Sections 1 through 9 of this document.\r
-\r
- "Licensor" shall mean the copyright owner or entity authorized by\r
- the copyright owner that is granting the License.\r
-\r
- "Legal Entity" shall mean the union of the acting entity and all\r
- other entities that control, are controlled by, or are under common\r
- control with that entity. For the purposes of this definition,\r
- "control" means (i) the power, direct or indirect, to cause the\r
- direction or management of such entity, whether by contract or\r
- otherwise, or (ii) ownership of fifty percent (50%) or more of the\r
- outstanding shares, or (iii) beneficial ownership of such entity.\r
-\r
- "You" (or "Your") shall mean an individual or Legal Entity\r
- exercising permissions granted by this License.\r
-\r
- "Source" form shall mean the preferred form for making modifications,\r
- including but not limited to software source code, documentation\r
- source, and configuration files.\r
-\r
- "Object" form shall mean any form resulting from mechanical\r
- transformation or translation of a Source form, including but\r
- not limited to compiled object code, generated documentation,\r
- and conversions to other media types.\r
-\r
- "Work" shall mean the work of authorship, whether in Source or\r
- Object form, made available under the License, as indicated by a\r
- copyright notice that is included in or attached to the work\r
- (an example is provided in the Appendix below).\r
-\r
- "Derivative Works" shall mean any work, whether in Source or Object\r
- form, that is based on (or derived from) the Work and for which the\r
- editorial revisions, annotations, elaborations, or other modifications\r
- represent, as a whole, an original work of authorship. For the purposes\r
- of this License, Derivative Works shall not include works that remain\r
- separable from, or merely link (or bind by name) to the interfaces of,\r
- the Work and Derivative Works thereof.\r
-\r
- "Contribution" shall mean any work of authorship, including\r
- the original version of the Work and any modifications or additions\r
- to that Work or Derivative Works thereof, that is intentionally\r
- submitted to Licensor for inclusion in the Work by the copyright owner\r
- or by an individual or Legal Entity authorized to submit on behalf of\r
- the copyright owner. For the purposes of this definition, "submitted"\r
- means any form of electronic, verbal, or written communication sent\r
- to the Licensor or its representatives, including but not limited to\r
- communication on electronic mailing lists, source code control systems,\r
- and issue tracking systems that are managed by, or on behalf of, the\r
- Licensor for the purpose of discussing and improving the Work, but\r
- excluding communication that is conspicuously marked or otherwise\r
- designated in writing by the copyright owner as "Not a Contribution."\r
-\r
- "Contributor" shall mean Licensor and any individual or Legal Entity\r
- on behalf of whom a Contribution has been received by Licensor and\r
- subsequently incorporated within the Work.\r
-\r
- 2. Grant of Copyright License. Subject to the terms and conditions of\r
- this License, each Contributor hereby grants to You a perpetual,\r
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
- copyright license to reproduce, prepare Derivative Works of,\r
- publicly display, publicly perform, sublicense, and distribute the\r
- Work and such Derivative Works in Source or Object form.\r
-\r
- 3. Grant of Patent License. Subject to the terms and conditions of\r
- this License, each Contributor hereby grants to You a perpetual,\r
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
- (except as stated in this section) patent license to make, have made,\r
- use, offer to sell, sell, import, and otherwise transfer the Work,\r
- where such license applies only to those patent claims licensable\r
- by such Contributor that are necessarily infringed by their\r
- Contribution(s) alone or by combination of their Contribution(s)\r
- with the Work to which such Contribution(s) was submitted. If You\r
- institute patent litigation against any entity (including a\r
- cross-claim or counterclaim in a lawsuit) alleging that the Work\r
- or a Contribution incorporated within the Work constitutes direct\r
- or contributory patent infringement, then any patent licenses\r
- granted to You under this License for that Work shall terminate\r
- as of the date such litigation is filed.\r
-\r
- 4. Redistribution. You may reproduce and distribute copies of the\r
- Work or Derivative Works thereof in any medium, with or without\r
- modifications, and in Source or Object form, provided that You\r
- meet the following conditions:\r
-\r
- (a) You must give any other recipients of the Work or\r
- Derivative Works a copy of this License; and\r
-\r
- (b) You must cause any modified files to carry prominent notices\r
- stating that You changed the files; and\r
-\r
- (c) You must retain, in the Source form of any Derivative Works\r
- that You distribute, all copyright, patent, trademark, and\r
- attribution notices from the Source form of the Work,\r
- excluding those notices that do not pertain to any part of\r
- the Derivative Works; and\r
-\r
- (d) If the Work includes a "NOTICE" text file as part of its\r
- distribution, then any Derivative Works that You distribute must\r
- include a readable copy of the attribution notices contained\r
- within such NOTICE file, excluding those notices that do not\r
- pertain to any part of the Derivative Works, in at least one\r
- of the following places: within a NOTICE text file distributed\r
- as part of the Derivative Works; within the Source form or\r
- documentation, if provided along with the Derivative Works; or,\r
- within a display generated by the Derivative Works, if and\r
- wherever such third-party notices normally appear. The contents\r
- of the NOTICE file are for informational purposes only and\r
- do not modify the License. You may add Your own attribution\r
- notices within Derivative Works that You distribute, alongside\r
- or as an addendum to the NOTICE text from the Work, provided\r
- that such additional attribution notices cannot be construed\r
- as modifying the License.\r
-\r
- You may add Your own copyright statement to Your modifications and\r
- may provide additional or different license terms and conditions\r
- for use, reproduction, or distribution of Your modifications, or\r
- for any such Derivative Works as a whole, provided Your use,\r
- reproduction, and distribution of the Work otherwise complies with\r
- the conditions stated in this License.\r
-\r
- 5. Submission of Contributions. Unless You explicitly state otherwise,\r
- any Contribution intentionally submitted for inclusion in the Work\r
- by You to the Licensor shall be under the terms and conditions of\r
- this License, without any additional terms or conditions.\r
- Notwithstanding the above, nothing herein shall supersede or modify\r
- the terms of any separate license agreement you may have executed\r
- with Licensor regarding such Contributions.\r
-\r
- 6. Trademarks. This License does not grant permission to use the trade\r
- names, trademarks, service marks, or product names of the Licensor,\r
- except as required for reasonable and customary use in describing the\r
- origin of the Work and reproducing the content of the NOTICE file.\r
-\r
- 7. Disclaimer of Warranty. Unless required by applicable law or\r
- agreed to in writing, Licensor provides the Work (and each\r
- Contributor provides its Contributions) on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\r
- implied, including, without limitation, any warranties or conditions\r
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\r
- PARTICULAR PURPOSE. You are solely responsible for determining the\r
- appropriateness of using or redistributing the Work and assume any\r
- risks associated with Your exercise of permissions under this License.\r
-\r
- 8. Limitation of Liability. In no event and under no legal theory,\r
- whether in tort (including negligence), contract, or otherwise,\r
- unless required by applicable law (such as deliberate and grossly\r
- negligent acts) or agreed to in writing, shall any Contributor be\r
- liable to You for damages, including any direct, indirect, special,\r
- incidental, or consequential damages of any character arising as a\r
- result of this License or out of the use or inability to use the\r
- Work (including but not limited to damages for loss of goodwill,\r
- work stoppage, computer failure or malfunction, or any and all\r
- other commercial damages or losses), even if such Contributor\r
- has been advised of the possibility of such damages.\r
-\r
- 9. Accepting Warranty or Additional Liability. While redistributing\r
- the Work or Derivative Works thereof, You may choose to offer,\r
- and charge a fee for, acceptance of support, warranty, indemnity,\r
- or other liability obligations and/or rights consistent with this\r
- License. However, in accepting such obligations, You may act only\r
- on Your own behalf and on Your sole responsibility, not on behalf\r
- of any other Contributor, and only if You agree to indemnify,\r
- defend, and hold each Contributor harmless for any liability\r
- incurred by, or claims asserted against, such Contributor by reason\r
- of your accepting any such warranty or additional liability.\r
-\r
- END OF TERMS AND CONDITIONS\r
-\r
- APPENDIX: How to apply the Apache License to your work.\r
-\r
- To apply the Apache License to your work, attach the following\r
- boilerplate notice, with the fields enclosed by brackets "[]"\r
- replaced with your own identifying information. (Don't include\r
- the brackets!) The text should be enclosed in the appropriate\r
- comment syntax for the file format. We also recommend that a\r
- file or class name and description of purpose be included on the\r
- same "printed page" as the copyright notice for easier\r
- identification within third-party archives.\r
-\r
- Copyright [yyyy] [name of copyright owner]\r
-\r
- Licensed under the Apache License, Version 2.0 (the "License");\r
- you may not use this file except in compliance with the License.\r
- You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
- Unless required by applicable law or agreed to in writing, software\r
- distributed under the License is distributed on an "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
+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.
+
</method>
<method name="Answer">
- <arg direction="in" type="i" name="call_id"/>
+ <arg direction="in" type="i" name="call_handle"/>
<arg direction="in" type="i" name="answer_type"/>
<arg direction="out" type="i" name="result"/>
- <arg direction="out" type="i" name="call_id"/>
+ <arg direction="out" type="i" name="call_handle"/>
</method>
<method name="End">
- <arg direction="in" type="i" name="call_id"/>
+ <arg direction="in" type="i" name="call_handle"/>
<arg direction="in" type="i" name="end_type"/>
<arg direction="out" type="i" name="result"/>
- <arg direction="out" type="i" name="call_id"/>
+ <arg direction="out" type="i" name="call_handle"/>
<arg direction="out" type="i" name="end_type"/>
</method>
</method>
<method name="Active">
- <arg direction="in" type="i" name="call_id"/>
+ <arg direction="in" type="i" name="call_handle"/>
<arg direction="out" type="i" name="result"/>
- <arg direction="out" type="i" name="call_id"/>
+ <arg direction="out" type="i" name="call_handle"/>
</method>
<method name="Hold">
- <arg direction="in" type="i" name="call_id"/>
+ <arg direction="in" type="i" name="call_handle"/>
<arg direction="out" type="i" name="result"/>
- <arg direction="out" type="i" name="call_id"/>
+ <arg direction="out" type="i" name="call_handle"/>
</method>
<method name="Swap">
- <arg direction="in" type="i" name="call_id"/>
+ <arg direction="in" type="i" name="call_handle"/>
<arg direction="out" type="i" name="result"/>
- <arg direction="out" type="i" name="call_id"/>
+ <arg direction="out" type="i" name="call_handle"/>
</method>
<method name="Join">
- <arg direction="in" type="i" name="call_id"/>
+ <arg direction="in" type="i" name="call_handle"/>
<arg direction="out" type="i" name="result"/>
- <arg direction="out" type="i" name="call_id"/>
+ <arg direction="out" type="i" name="call_handle"/>
</method>
<method name="Split">
- <arg direction="in" type="i" name="call_id"/>
+ <arg direction="in" type="i" name="call_handle"/>
<arg direction="out" type="i" name="result"/>
- <arg direction="out" type="i" name="call_id"/>
+ <arg direction="out" type="i" name="call_handle"/>
</method>
<method name="Transfer">
- <arg direction="in" type="i" name="call_id"/>
+ <arg direction="in" type="i" name="call_handle"/>
<arg direction="out" type="i" name="result"/>
- <arg direction="out" type="i" name="call_id"/>
+ <arg direction="out" type="i" name="call_handle"/>
</method>
<method name="Deflect">
</method>
<method name="GetStatus">
- <arg direction="in" type="i" name="call_id"/>
- <arg direction="out" type="i" name="call_id"/>
+ <arg direction="in" type="i" name="call_handle"/>
+ <arg direction="out" type="i" name="call_handle"/>
<arg direction="out" type="s" name="call_number"/>
<arg direction="out" type="i" name="call_type"/>
<arg direction="out" type="b" name="call_direction"/>
<arg direction="out" type="i" name="call_state"/>
<arg direction="out" type="b" name="call_multiparty_state"/>
+ <arg direction="out" type="b" name="is_volte_call"/>
</method>
<method name="GetStatusAll">
<arg direction="out" type="i" name="result"/>
</method>
+ <method name="Modify">
+ <arg direction="in" type="i" name="call_handle"/>
+ <arg direction="in" type="i" name="call_type"/>
+ <arg direction="out" type="i" name="result"/>
+ </method>
+
+ <method name="ConfirmModify">
+ <arg direction="in" type="i" name="call_handle"/>
+ <arg direction="in" type="i" name="confirm_type"/>
+ <arg direction="out" type="i" name="result"/>
+ </method>
+
<signal name="VoiceCallStatusIdle">
- <arg type="i" name="call_id"/>
+ <arg type="i" name="call_handle"/>
<arg type="i" name="end_cause"/>
<arg type="i" name="start_time"/>
<arg type="i" name="end_time"/>
</signal>
<signal name="VoiceCallStatusDialing">
- <arg type="i" name="call_id"/>
+ <arg type="i" name="call_handle"/>
</signal>
<signal name="VoiceCallStatusAlert">
- <arg type="i" name="call_id"/>
+ <arg type="i" name="call_handle"/>
</signal>
<signal name="VoiceCallStatusActive">
- <arg type="i" name="call_id"/>
+ <arg type="i" name="call_handle"/>
</signal>
<signal name="VoiceCallStatusHeld">
- <arg type="i" name="call_id"/>
+ <arg type="i" name="call_handle"/>
</signal>
<signal name="VoiceCallStatusIncoming">
- <arg type="i" name="call_id"/>
+ <arg type="i" name="call_handle"/>
+ <arg type="i" name="cli_mode"/>
+ <arg type="i" name="cli_cause"/>
+ <arg type="s" name="call_number"/>
+ <arg type="b" name="forwarded"/>
+ <arg type="i" name="active_line"/>
+ <arg type="s" name="call_name"/>
</signal>
<signal name="VideoCallStatusIdle">
- <arg type="i" name="call_id"/>
+ <arg type="i" name="call_handle"/>
<arg type="i" name="end_cause"/>
<arg type="i" name="start_time"/>
<arg type="i" name="end_time"/>
</signal>
<signal name="VideoCallStatusDialing">
- <arg type="i" name="call_id"/>
+ <arg type="i" name="call_handle"/>
</signal>
<signal name="VideoCallStatusAlert">
- <arg type="i" name="call_id"/>
+ <arg type="i" name="call_handle"/>
</signal>
<signal name="VideoCallStatusActive">
- <arg type="i" name="call_id"/>
+ <arg type="i" name="call_handle"/>
</signal>
<signal name="VideoCallStatusIncoming">
- <arg type="i" name="call_id"/>
+ <arg type="i" name="call_handle"/>
+ <arg type="i" name="cli_mode"/>
+ <arg type="i" name="cli_cause"/>
+ <arg type="s" name="call_number"/>
+ <arg type="b" name="forwarded"/>
+ <arg type="i" name="active_line"/>
+ <arg type="s" name="call_name"/>
</signal>
<signal name="Waiting">
- <arg type="i" name="call_id"/>
+ <arg type="i" name="call_handle"/>
</signal>
<signal name="Forwarded">
- <arg type="i" name="call_id"/>
+ <arg type="i" name="call_handle"/>
</signal>
<signal name="ForwardedCall">
- <arg type="i" name="call_id"/>
+ <arg type="i" name="call_handle"/>
</signal>
<signal name="BarredIncoming">
- <arg type="i" name="call_id"/>
+ <arg type="i" name="call_handle"/>
</signal>
<signal name="BarredOutgoing">
- <arg type="i" name="call_id"/>
+ <arg type="i" name="call_handle"/>
</signal>
<signal name="ForwardConditional">
- <arg type="i" name="call_id"/>
+ <arg type="i" name="call_handle"/>
</signal>
<signal name="ForwardUnconditional">
- <arg type="i" name="call_id"/>
+ <arg type="i" name="call_handle"/>
</signal>
<signal name="CallActive">
- <arg type="i" name="call_id"/>
+ <arg type="i" name="call_handle"/>
</signal>
<signal name="CallHeld">
- <arg type="i" name="call_id"/>
+ <arg type="i" name="call_handle"/>
</signal>
<signal name="CallJoined">
- <arg type="i" name="call_id"/>
+ <arg type="i" name="call_handle"/>
</signal>
<signal name="CallPrivacyMode">
<signal name="CallPreferredVoiceSubscription">
<arg type="i" name="preferred_subs"/>
</signal>
+
+ <signal name="CallModifyRequest">
+ <arg type="i" name="call_handle"/>
+ <arg type="i" name="call_type"/>
+ </signal>
+
+
+ <signal name="CallFallback">
+ <arg type="i" name="call_handle"/>
+ <arg type="i" name="fallback_to"/>
+ </signal>
</interface>
</node>
+++ /dev/null
-<node>
- <!--
- org.tizen.telephony.Network:
- @short_description: Tizen Telephony Network interface
-
- Network interface.
-
- -->
- <interface name="org.tizen.telephony.Network">
- <!--
- Search:
- @result: Success(0)
- @list: An array of dict with network information. <para>dict key/value:</para><variablelist><varlistentry><term><literal>"plmn"</literal></term><listitem><type>string</type></listitem></varlistentry><varlistentry><term><literal>"act"</literal></term><listitem><type>int</type></listitem></varlistentry><varlistentry><term><literal>"type"</literal></term><listitem><type>int</type> Unknown(0), Home Plmn(1), Available Plmn(2), Forbidden Plmn(3)</listitem></varlistentry><varlistentry><term><literal>"name"</literal></term><listitem><type>string</type></listitem></varlistentry></variablelist>
-
- Request to do manual network selection to search for the available networks and provide the network list
-
- -->
- <method name="Search">
- <arg direction="out" type="aa{sv}" name="list"/>
- <arg direction="out" type="i" name="result"/>
- </method>
-
- <!--
- SearchCancel:
- @result: Success(0)
-
- Cancle the org.tizen.telephony.Network.Search() request.
- -->
- <method name="SearchCancel">
- <arg direction="out" type="i" name="result"/>
- </method>
-
- <!--
- SetSelectionMode:
- @mode: Selection mode. Manual(0), Automatic(1)
- @plmn: Plmn string.
- @act: Access technology. GSM(1), GPRS(2), EGPRS(3), UMTS(4), IS95A(17), IS95B(18), EHRPD(25), LTE(33)
- @result: Success(0)
-
- Set network selection mode
- -->
- <method name="SetSelectionMode">
- <arg direction="in" type="i" name="mode"/>
- <arg direction="in" type="s" name="plmn"/>
- <arg direction="in" type="i" name="act"/>
- <arg direction="out" type="i" name="result"/>
- </method>
- <!--
- GetSelectionMode:
- @mode: Selection mode. Manual(0), Automatic(1)
- @result: Success(0)
-
- Get network selection mode
- -->
- <method name="GetSelectionMode">
- <arg direction="out" type="i" name="mode"/>
- <arg direction="out" type="i" name="result"/>
- </method>
-
- <!--
- SetServiceDomain:
- @domain: Service domain. Combined(0), Circuit Service(1), Packet Service(2)
- @result: Success(0)
-
- Set network service domain
- -->
- <method name="SetServiceDomain">
- <arg direction="in" type="i" name="domain"/>
- <arg direction="out" type="i" name="result"/>
- </method>
- <!--
- GetServiceDomain:
- @domain: Service domain. Combined(0), Circuit Service(1), Packet Service(2)
- @result: Success(0)
-
- Get network service domain
- -->
- <method name="GetServiceDomain">
- <arg direction="out" type="i" name="domain"/>
- <arg direction="out" type="i" name="result"/>
- </method>
-
- <!--
- SetBand:
- @band: Network band. ANY(0), GSM850(1), GSM900_1800(2), GSM1900(3), GSM(4), WCDMA(5), WCDMA850(6), WCDMA1900(7), WCDMA2100(8), GSM900(9), GSM1800(10), GSM850_1900(11)
- @mode: Mode. Preferred(1), Only(2)
- @result: Success(0)
-
- Set network band
- -->
- <method name="SetBand">
- <arg direction="in" type="i" name="band"/>
- <arg direction="in" type="i" name="mode"/>
- <arg direction="out" type="i" name="result"/>
- </method>
- <!--
- GetBand:
- @band: Network band. ANY(0), GSM850(1), GSM900_1800(2), GSM1900(3), GSM(4), WCDMA(5), WCDMA850(6), WCDMA1900(7), WCDMA2100(8), GSM900(9), GSM1800(10), GSM850_1900(11)
- @mode: Mode. Preferred(1), Only(2)
- @result: Success(0)
-
- Get network band
- -->
- <method name="GetBand">
- <arg direction="out" type="i" name="band"/>
- <arg direction="out" type="i" name="mode"/>
- <arg direction="out" type="i" name="result"/>
- </method>
-
- <!--
- SetPreferredPlmn:
- @mode: add(1), edit(2), delete(3)
- @ef_index: Operator index in the EFplmnsel of the SIM
- @act: Access technology. GSM(1), GPRS(2), EGPRS(3), UMTS(4), IS95A(17), IS95B(18), EHRPD(25), LTE(33)
- @plmn: Plmn
- @result: Success(0)
-
- Set Preferred Plmn
- -->
- <method name="SetPreferredPlmn">
- <arg direction="in" type="i" name="mode"/>
- <arg direction="in" type="i" name="ef_index"/>
- <arg direction="in" type="i" name="act"/>
- <arg direction="in" type="s" name="plmn"/>
- <arg direction="out" type="i" name="result"/>
- </method>
- <!--
- GetPreferredPlmn:
- @list: A set of key/dict paris with preferred plmn list. <para>dict items are:</para><itemizedlist><listitem>"plmn" <type>string</type></listitem><listitem>"act" <type>int</type></listitem><listitem>"ef_index" <type>int</type></listitem></itemizedlist>
- @result: Success(0)
-
- Get Preferred Plmn list
- -->
- <method name="GetPreferredPlmn">
- <arg direction="out" type="aa{sv}" name="list"/>
- <arg direction="out" type="i" name="result"/>
- </method>
-
- <!--
- SetOrder:
- @order: Acquisition Order. AUTO(1), GSM FIRST(2), WCDMA FIRST(3), LTE FIRST(4)
- @result: Success(0)
-
- Set network acquisition order
- -->
- <method name="SetOrder">
- <arg direction="in" type="i" name="order"/>
- <arg direction="out" type="i" name="result"/>
- </method>
- <!--
- GetOrder:
- @order: Acquisition Order. AUTO(1), GSM FIRST(2), WCDMA FIRST(3), LTE FIRST(4)
- @result: Success(0)
-
- Get network acquisition order
- -->
- <method name="GetOrder">
- <arg direction="out" type="i" name="order"/>
- <arg direction="out" type="i" name="result"/>
- </method>
-
- <!--
- SetPowerOnAttach:
- @enable: Power on attach configuration. Enable(TRUE), Disable(FALSE)
- @result: Success(0)
-
- Set power on attach configuration
- -->
- <method name="SetPowerOnAttach">
- <arg direction="in" type="b" name="enable"/>
- <arg direction="out" type="i" name="result"/>
- </method>
- <!--
- GetPowerOnAttach:
- @enable: Power on attach configuration. Enable(TRUE), Disable(FALSE)
- @result: Success(0)
-
- Get power on attach configuration
- -->
- <method name="GetPowerOnAttach">
- <arg direction="out" type="b" name="enable"/>
- <arg direction="out" type="i" name="result"/>
- </method>
-
- <!--
- GetServingNetwork:
- @act: Access technology. GSM(1), GPRS(2), EGPRS(3), UMTS(4), IS95A(17), IS95B(18), EHRPD(25), LTE(33)
- @plmn: Plmn string.
- @status: Registration status. NOT REGISTER(1), REGISTER HOME(2), SEARCHING(3), DENIED(4), UNKNOWN(5), REGISTER ROAM(6)
- @lac: Location Area Code.
- @result: Success(0)
-
- Set power on attach configuration
- -->
- <method name="GetServingNetwork">
- <arg direction="out" type="i" name="act"/>
- <arg direction="out" type="s" name="status"/>
- <arg direction="out" type="s" name="plmn"/>
- <arg direction="out" type="i" name="lac"/>
- <arg direction="out" type="i" name="result"/>
- </method>
-
- <!--
- RegistrationStatus:
- @circuit: Circuit service status.
- @packet: Packet service status.
- @type: Service type. UNKNOWN(0), NO SERVICE(1), EMERGENCY(2), SEARCH(3), 2G(4), 2.5G(5), 2.5G EDGE(6), 3G(7)
- @roaming: Roaming status.
-
- Network registration status.
- -->
- <signal name="RegistrationStatus">
- <arg type="i" name="circuit"/>
- <arg type="i" name="packet"/>
- <arg type="i" name="type"/>
- <arg type="b" name="roaming"/>
- </signal>
-
- <!--
- Info:
- @rssi: Radio Signal Strength infomation. (0 ~ 6)
- @battery: Battery information. (0 ~ 5)
-
- RSSI and Battery information.
- -->
- <signal name="Info">
- <arg type="i" name="rssi"/>
- <arg type="i" name="battery"/>
- </signal>
-
- <!--
- Change:
- @act: Access technology. GSM(1), GPRS(2), EGPRS(3), UMTS(4), IS95A(17), IS95B(18), EHRPD(25), LTE(33)
- @plmn: Plmn string.
- @lac: Location Area Code.
-
- Network change.
- -->
- <signal name="Change">
- <arg type="i" name="act"/>
- <arg type="s" name="plmn"/>
- <arg type="i" name="lac"/>
- </signal>
-
- <!--
- TimeInfo:
- @year: Year. (year - 2000). e.g. 2012 is 12
- @month: Month. (1 ~ 12)
- @day: Day (1 ~ 31)
- @hour: Hour (0 ~ 23)
- @minute: Minute (0 ~ 59)
- @second: Second (0 ~ 59)
- @wday: Day of week (0:Sunday ~ 6:Saturday)
- @gmtoff: GMT Offset (minutes). e.g. GMT+9 is 540
- @dstoff: Daylight adjust time. (hours)
- @isdst: Daylight flag
- @plmn: Plmn
-
- Network time information.
- -->
- <signal name="TimeInfo">
- <arg type="i" name="year"/>
- <arg type="i" name="month"/>
- <arg type="i" name="day"/>
- <arg type="i" name="hour"/>
- <arg type="i" name="minute"/>
- <arg type="i" name="second"/>
- <arg type="i" name="wday"/>
- <arg type="i" name="gmtoff"/>
- <arg type="i" name="dstoff"/>
- <arg type="b" name="isdst"/>
- <arg type="s" name="plmn"/>
- </signal>
-
- <!--
- Identity:
- @plmn: Plmn string.
- @short_name: Network name (short - 16 bytes)
- @full_name: Network name (full - 32 bytes)
-
- Network identity information.
- -->
- <signal name="Identity">
- <arg type="s" name="plmn"/>
- <arg type="s" name="short_name"/>
- <arg type="s" name="full_name"/>
- </signal>
-
- <!--
- CellInfo:
- @lac: Location Area Code.
- @cell_id: Cell ID
-
- Network location and cell information.
- -->
- <signal name="CellInfo">
- <arg type="i" name="lac"/>
- <arg type="i" name="cell_id"/>
- </signal>
-
- </interface>
-
- <interface name="org.tizen.telephony.SIM">
- <property name="Type" type="s" access="read"/>
- <property name="Mcc" type="s" access="read"/>
- <property name="Mnc" type="s" access="read"/>
- <property name="Msin" type="s" access="read"/>
- <property name="sim_init" type="i" access="read"/>
- <property name="sim_changed" type="b" access="read"/>
-
- <method name="GetECC">
- <arg direction="out" type="i" name="result"/>
- <arg direction="out" type="i" name="count"/>
- <!-- object
- <arg direction="out" type="s" name="name"/>
- <arg direction="out" type="s" name="number"/>
- <arg direction="out" type="i" name="category"/>
- -->
- </method>
-
- <method name="GetICCID">
- <arg direction="out" type="s" name="iccid"/>
- </method>
-
- <method name="GetLanguage">
- <arg direction="out" type="i" name="result"/>
- <arg direction="out" type="i" name="language"/>
- </method>
-
- <method name="SetLanguage">
- <arg direction="in" type="i" name="language"/>
- <arg direction="out" type="i" name="result"/>
- </method>
-
- <method name="GetCallforwarding">
- <arg direction="out" type="i" name="result"/>
- </method>
-
- <method name="GetMessageWaiting">
- <arg direction="out" type="i" name="result"/>
- </method>
-
- <method name="GetMailbox">
- <arg direction="out" type="i" name="result"/>
- </method>
-
- <method name="GetCPHSInfo">
- <arg direction="out" type="i" name="result"/>
- </method>
-
- <method name="GetMSISDN">
- <arg direction="out" type="i" name="result"/>
- </method>
-
- <method name="Authentication">
- <arg direction="out" type="i" name="result"/>
- </method>
-
- <method name="VerifySec">
- <arg direction="out" type="i" name="result"/>
- </method>
-
- <method name="VerifyPUK">
- <arg direction="out" type="i" name="result"/>
- </method>
-
- <method name="ChangePIN">
- <arg direction="out" type="i" name="result"/>
- </method>
-
- <method name="DisableFacility">
- <arg direction="out" type="i" name="result"/>
- </method>
-
- <method name="EnableFacility">
- <arg direction="out" type="i" name="result"/>
- </method>
-
- <method name="GetFacility">
- <arg direction="out" type="i" name="result"/>
- </method>
-
- <method name="TransferAPDU">
- <arg direction="out" type="i" name="result"/>
- </method>
-
- <method name="GetATR">
- <arg direction="out" type="i" name="result"/>
- </method>
-
- <signal name="SimStatus">
- <arg type="i" name="status"/>
- </signal>
-
- </interface>
-
- <interface name="org.tizen.telephony.phonebook">
- <property name="Status" type="i" access="read"/>
- <property name="Support_list" type="as" access="read"/>
-
- <method name="GetCount">
- <arg direction="in" type="i" name="req_type"/>
- <arg direction="out" type="i" name="result"/>
- <arg direction="out" type="i" name="resp_type"/>
- <arg direction="out" type="i" name="used"/>
- <arg direction="out" type="i" name="total"/>
- </method>
-
- <method name="GetInfo">
- <arg direction="in" type="i" name="req_type"/>
- <arg direction="out" type="i" name="result"/>
- <arg direction="out" type="i" name="resp_type"/>
- <arg direction="out" type="i" name="index_min"/>
- <arg direction="out" type="i" name="index_max"/>
- <arg direction="out" type="i" name="number_length_max"/>
- <arg direction="out" type="i" name="text_length_max"/>
- </method>
-
- <method name="ReadRecord">
- <arg direction="in" type="i" name="req_type"/>
- <arg direction="in" type="i" name="index"/>
- <arg direction="out" type="i" name="result"/>
- <arg direction="out" type="i" name="resp_type"/>
- <arg direction="out" type="i" name="index"/>
- <arg direction="out" type="i" name="next_index"/>
- <arg direction="out" type="s" name="name"/>
- <arg direction="out" type="i" name="dcs"/>
- <arg direction="out" type="s" name="number"/>
- <arg direction="out" type="i" name="ton"/>
- <arg direction="out" type="s" name="number2"/>
- <arg direction="out" type="i" name="number2_ton"/>
- <arg direction="out" type="s" name="number3"/>
- <arg direction="out" type="i" name="number3_ton"/>
- <arg direction="out" type="s" name="number4"/>
- <arg direction="out" type="i" name="number4_ton"/>
- <arg direction="out" type="s" name="email1"/>
- <arg direction="out" type="s" name="email2"/>
- <arg direction="out" type="s" name="email3"/>
- <arg direction="out" type="s" name="email4"/>
- <arg direction="out" type="i" name="group_index"/>
- </method>
-
- <method name="UpdateRecord">
- <arg direction="in" type="i" name="type"/>
- <arg direction="in" type="i" name="index"/>
- <arg direction="in" type="s" name="name"/>
- <arg direction="in" type="i" name="dcs"/>
- <arg direction="in" type="s" name="number"/>
- <arg direction="in" type="i" name="ton"/>
- <arg direction="in" type="s" name="number2"/>
- <arg direction="in" type="i" name="number2_ton"/>
- <arg direction="in" type="s" name="number3"/>
- <arg direction="in" type="i" name="number3_ton"/>
- <arg direction="in" type="s" name="number4"/>
- <arg direction="in" type="i" name="number4_ton"/>
- <arg direction="in" type="s" name="email1"/>
- <arg direction="in" type="s" name="email2"/>
- <arg direction="in" type="s" name="email3"/>
- <arg direction="in" type="s" name="email4"/>
- <arg direction="in" type="i" name="group_index"/>
- <arg direction="out" type="i" name="result"/>
- </method>
-
- <method name="DeleteRecord">
- <arg direction="in" type="i" name="type"/>
- <arg direction="in" type="i" name="index"/>
- <arg direction="out" type="i" name="result"/>
- </method>
-
- <signal name="PhonebookStatus">
- <arg type="i" name="status"/>
- </signal>
-
- </interface>
-
- <interface name="org.tizen.telephony.SAP">
-
- <method name="Connect">
- <arg direction="in" type="i" name="req_max_size"/>
- <arg direction="out" type="i" name="result"/>
- <arg direction="out" type="i" name="resp_max_size"/>
- </method>
-
- <method name="Disconnect">
- <arg direction="out" type="i" name="result"/>
- </method>
-
- <method name="GetStatus">
- <arg direction="out" type="i" name="status"/>
- </method>
-
- <method name="GetATR">
- <arg direction="out" type="i" name="result"/>
- <arg direction="out" type="y" name="atr"/>
- </method>
-
- <method name="TransferAPDU">
- <arg direction="in" type="y" name="req_apdu"/>
- <arg direction="out" type="i" name="result"/>
- <arg direction="out" type="y" name="resp_apdu"/>
- </method>
-
- <method name="SetProtocol">
- <arg direction="in" type="i" name="protocol"/>
- <arg direction="out" type="i" name="result"/>
- </method>
-
- <method name="SetPower">
- <arg direction="in" type="i" name="mode"/>
- <arg direction="out" type="i" name="result"/>
- </method>
-
- <method name="GetCardReaderStatus">
- <arg direction="out" type="i" name="result"/>
- <arg direction="out" type="i" name="status"/>
- </method>
-
- <signal name="status">
- <arg type="i" name="status"/>
- </signal>
-
- <signal name="disconnect">
- <arg type="i" name="type"/>
- </signal>
-
- </interface>
-
- <interface name="org.tizen.telephony.SAT">
- <property name="Type" type="s" access="read"/>
- </interface>
-
- <interface name="org.tizen.telephony.Manager">
- <method name="GetModems">
- <arg direction="out" type="as" name="list"/>
- </method>
- </interface>
-
-</node>
--c-namespace Telephony \
--c-generate-object-manager \
--generate-docbook generated-docs \
- manager.xml network.xml sim.xml phonebook.xml sat.xml sap.xml gps.xml oem.xml modem.xml ss.xml call.xml sms.xml
+ manager.xml network.xml sim.xml phonebook.xml sat.xml sap.xml oem.xml modem.xml ss.xml call.xml sms.xml
+++ /dev/null
-<node>
- <!--
- org.tizen.telephony.Gps:
- @short_description: Tizen Telephony Gps interface
-
- Gps interface.
-
- -->
- <interface name="org.tizen.telephony.Gps">
- <method name="SetFrequencyAiding">
- <arg direction="in" type="y" name="state"/>
- <arg direction="out" type="i" name="result"/>
- </method>
- <method name="ConfirmMeasurePos">
- <arg direction="in" type="s" name="data"/>
- <arg direction="out" type="i" name="result"/>
- </method>
- <method name="EnableSmartAssistant">
- <arg direction="out" type="i" name="result"/>
- </method>
- <method name="DisableSmartAssistant">
- <arg direction="out" type="i" name="result"/>
- </method>
- <method name="SyncSmartAssistantAreaList">
- <arg direction="in" type="i" name="count"/>
- <arg direction="in" type="v" name="list"/>
- <arg direction="out" type="i" name="result"/>
- </method>
- <method name="DelSmartAssistantAreaList">
- <arg direction="in" type="i" name="count"/>
- <arg direction="in" type="v" name="list"/>
- <arg direction="out" type="i" name="result"/>
- </method>
- <method name="AddSmartAssistantArea">
- <arg direction="in" type="i" name="index"/>
- <arg direction="in" type="i" name="mode_state"/>
- <arg direction="out" type="i" name="result"/>
- </method>
- <method name="ModifySmartAssistantArea">
- <arg direction="in" type="i" name="index"/>
- <arg direction="in" type="i" name="mode_state"/>
- <arg direction="out" type="i" name="result"/>
- </method>
- <method name="SetSmartAssistantInfo">
- <arg direction="in" type="i" name="index"/>
- <arg direction="in" type="i" name="lpp_state"/>
- <arg direction="out" type="i" name="result"/>
- </method>
- <signal name="AssistData">
- <arg type="s" name="data"/>
- </signal>
- <signal name="MeasurePosition">
- <arg type="s" name="data"/>
- </signal>
- <signal name="ResetAssistData">
- </signal>
- <signal name="FrequencyAiding">
- <arg type="s" name="data"/>
- </signal>
- <signal name="AreaStatus">
- <arg type="i" name="status"/>
- <arg type="i" name="index"/>
- </signal>
- <signal name="SyncStatus">
- <arg type="i" name="status"/>
- <arg type="i" name="cause"/>
- </signal>
- </interface>
-
-</node>
<arg direction="out" type="s" name="hardware"/>
<arg direction="out" type="s" name="rf_cal_date"/>
<arg direction="out" type="s" name="product_code"/>
+ <arg direction="out" type="s" name="prl_version"/>
+ <arg direction="out" type="s" name="eri_version"/>
</method>
<!--
<arg direction="out" type="i" name="result"/>
</method>
+ <method name="GetDeviceInfo">
+ <arg direction="out" type="i" name="result"/>
+ <arg direction="out" type="s" name="vendor_name"/>
+ <arg direction="out" type="s" name="device_name"/>
+ </method>
+
<!--
Power:
@status: Online(0), Offline(1), Error(2), Unknown(3)
<!-- power: Power status -->
<property name="power" type="i" access="read"/>
+ <!--
+ dongle_status: Dongle insertion status
+ 0=Removed, 1=Inserted
+ -->
+ <property name="dongle_status" type="i" access="read"/>
+
+ <!--
+ dongle_login: Dongle login status
+ 0=Failure, 1=Success
+ -->
+ <property name="dongle_login" type="i" access="read"/>
+
</interface>
</node>
<!--
GetServingNetwork:
+ @info: A set of key/dict pairs with serving network information.
@act: Access technology. GSM(1), GPRS(2), EGPRS(3), UMTS(4), IS95A(17), IS95B(18), EHRPD(25), LTE(33)
@plmn: Plmn string.
@status: Registration status. NOT REGISTER(1), REGISTER HOME(2), SEARCHING(3), DENIED(4), UNKNOWN(5), REGISTER ROAM(6)
@lac: Location Area Code.
@result: Success(0)
- Set power on attach configuration
+ Get Serving Network information
-->
<method name="GetServingNetwork">
- <arg direction="out" type="i" name="act"/>
- <!-- arg direction="out" type="i" name="status" -->
- <arg direction="out" type="s" name="plmn"/>
- <arg direction="out" type="i" name="lac"/>
+ <arg direction="out" type="a{sv}" name="info"/>
<arg direction="out" type="i" name="result"/>
</method>
</method>
<!--
+ GetNetworkInfo:
+ @changed_type: changed property type
+ @circuit_status: Circuit service status.
+ @packet_status: Packet service status.
+ @service_type: Service type.
+ @roaming_status: Roaming status.
+ @access_technology: access_technology
+ @name_option: 0=None, 1=SIM(EFspn), 2=Operator, 3=Any(SIM/Network)
+ @plmn: Plmn string.
+ @spn_name: Service Provider Name
+ @network_name: Network Operator Name
+ @result: Success(0)
+
+ Get Network information.
+ -->
+ <method name="GetNetworkInfo">
+ <arg direction="out" type="i" name="changed_type"/>
+ <arg direction="out" type="i" name="service_type"/>
+ <arg direction="out" type="b" name="roaming_status"/>
+ <arg direction="out" type="i" name="name_option"/>
+ <arg direction="out" type="s" name="plmn"/>
+ <arg direction="out" type="s" name="spn_name"/>
+ <arg direction="out" type="s" name="network_name"/>
+ <arg direction="out" type="i" name="result"/>
+ </method>
+
+ <!--
RegistrationStatus:
@circuit: Circuit service status.
@packet: Packet service status.
<arg type="i" name="default_subs"/>
</signal>
+ <!--
+ PropertyInfo:
+ @changed_type: changed property type
+ @circuit_status: Circuit service status.
+ @packet_status: Packet service status.
+ @service_type: Service type.
+ @roaming_status: Roaming status.
+ @access_technology: access_technology
+ @name_option: 0=None, 1=SIM(EFspn), 2=Operator, 3=Any(SIM/Network)
+ @plmn: Plmn string.
+ @spn_name: Service Provider Name
+ @network_name: Network Operator Name
+ Network Property information.
+ -->
+ <signal name="PropertyInfo">
+ <arg type="i" name="changed_type"/>
+ <arg type="i" name="service_type"/>
+ <arg type="b" name="roaming_status"/>
+ <arg type="i" name="name_option"/>
+ <arg type="s" name="plmn"/>
+ <arg type="s" name="spn_name"/>
+ <arg type="s" name="network_name"/>
+ </signal>
+
<!-- sig_dbm : Signal Strength DBM -->
<property name="sig_dbm" type="i" access="read"/>
-->
<property name="spn_name" type="s" access="read"/>
+ <!--
+ ims_voice_status: IMS Voice Support Status on LTE
+ -1=UNKNOWN, 0=NOT SUPPORT, 1=SUPPORT
+ -->
+ <property name="ims_voice_status" type="i" access="read"/>
+
+ <!--
+ volte_enable
+ 0=Not available, 1=Available
+ -->
+ <property name="volte_enable" type="i" access="read"/>
+
</interface>
</node>
<arg type="b" name="b_gas"/>
</signal>
+ <signal name="ContactChange">
+ <arg type="i" name="type"/>
+ <arg type="q" name="index"/>
+ <arg type="i" name="operation"/>
+ </signal>
+
</interface>
</node>
-->
<interface name="org.tizen.telephony.SAT">
-
+
<method name="GetMainMenuInfo">
<arg direction="out" type="i" name="result"/>
<arg direction="out" type="i" name="command_id"/>
<arg direction="out" type="v" name="icon_list"/>
-->
</method>
-
+
<method name="SendUiDisplayStatus">
<arg direction="in" type="i" name="command_id"/>
<arg direction="in" type="b" name="display_status"/>
<arg direction="out" type="i" name="result"/>
</method>
-
+
<method name="SendUserConfirm">
<arg direction="in" type="i" name="command_id"/>
<arg direction="in" type="i" name="command_type"/>
<arg direction="in" type="i" name="user_confirm_type"/>
<arg direction="in" type="v" name="additional_data"/>
<arg direction="out" type="i" name="result"/>
- </method>
-
+ </method>
+
<method name="SelectMenu">
<arg direction="in" type="i" name="item_identifier"/>
<arg direction="in" type="b" name="help_request"/>
<arg direction="out" type="i" name="result"/>
<arg direction="out" type="i" name="envelop_rsp"/>
</method>
-
+
<method name="DownloadEvent">
<arg direction="in" type="i" name="event_download_type"/>
<arg direction="in" type="i" name="src_device"/>
<arg type="v" name="icon_list"/>
-->
</signal>
-
+
<signal name="DisplayText">
<arg type="i" name="command_id"/>
<arg type="s" name="text"/>
<!--
Enable below tag if SAT icon is supported...
<arg type="v" name="icon_id"/>
- -->
+ -->
</signal>
-
+
<signal name="SelectItem">
<arg type="i" name="command_id"/>
<arg type="b" name="help_info"/>
<arg type="v" name="icon_list"/>
-->
</signal>
-
+
<signal name="GetInkey">
<arg type="i" name="command_id"/>
<arg type="i" name="key_type"/>
<arg type="v" name="icon_id"/>
-->
</signal>
-
+
<signal name="GetInput">
<arg type="i" name="command_id"/>
<arg type="i" name="input_alphabet_type"/>
<arg type="v" name="icon_id"/>
-->
</signal>
-
+
<signal name="PlayTone">
<arg type="i" name="command_id"/>
<arg type="s" name="text"/>
<arg type="i" name="tone_type"/>
<arg type="i" name="duration"/>
</signal>
-
+
<signal name="SendSMS">
<arg type="i" name="command_id"/>
<arg type="s" name="text"/>
<arg type="v" name="tpdu_data"/>
<arg type="i" name="tpdu_data_len"/>
</signal>
-
+
<signal name="SendSS">
<arg type="i" name="command_id"/>
<arg type="s" name="text"/>
<arg type="s" name="call_number"/>
<arg type="i" name="duration"/>
</signal>
-
+
<signal name="SetupEventList">
- <arg type="i" name="event_cnt"/>
+ <arg type="y" name="event_cnt"/>
<arg type="v" name="evt_list"/>
</signal>
<arg type="v" name="icon_id"/>
-->
</signal>
-
+
<signal name="OpenChannel">
<arg type="i" name="command_id"/>
<arg type="s" name="text"/>
-->
<arg type="i" name="channel_id"/>
</signal>
-
+
<signal name="ReceiveData">
<arg type="i" name="command_id"/>
<arg type="s" name="text"/>
<arg type="i" name="refresh_type"/>
<arg type="v" name="file_list"/>
</signal>
-
+
<signal name="MoreTime">
</signal>
-
+
<signal name="SendDtmf">
<arg type="i" name="command_id"/>
<arg type="s" name="text"/>
<arg type="s" name="dtmf_str"/>
<arg type="i" name="dtmf_str_len"/>
</signal>
-
+
<signal name="LaunchBrowser">
<arg type="i" name="command_id"/>
<arg type="i" name="launch_type"/>
<arg type="v" name="icon_id"/>
-->
</signal>
-
+
<signal name="ProvideLocalInfo">
<arg type="i" name="info_type"/>
</signal>
-
+
<signal name="LanguageNotification">
<arg type="i" name="command_id"/>
<arg type="i" name="language"/>
<signal name="EndProactiveSession">
<arg type="i" name="command_type"/>
</signal>
-
+
<signal name="CallControlResult">
<arg type="i" name="call_ctrl_result"/>
<arg type="s" name="text"/>
</signal>
</interface>
-
+
</node>
<arg direction="out" type="i" name="result"/>
</method>
+ <method name="GetImpi">
+ <arg direction="out" type="i" name="result"/>
+ <arg direction="out" type="s" name="impi"/>
+ </method>
+
+ <method name="GetImpu">
+ <arg direction="out" type="i" name="result"/>
+ <arg direction="out" type="aa{sv}" name="list"/>
+ </method>
+
+ <method name="GetDomain">
+ <arg direction="out" type="i" name="result"/>
+ <arg direction="out" type="s" name="domain"/>
+ </method>
+
+ <method name="GetPcscf">
+ <arg direction="out" type="i" name="result"/>
+ <arg direction="out" type="aa{sv}" name="list"/>
+ </method>
+
+ <method name="GetAppList">
+ <arg direction="out" type="y" name="app_list"/>
+ </method>
+
+ <method name="GetIsimServiceTable">
+ <arg direction="out" type="i" name="result"/>
+ <arg direction="out" type="v" name="ist"/>
+ </method>
+
<signal name="Status">
<arg type="i" name="status"/>
</signal>
<interface name="org.tizen.telephony.sms">
<!--
SendMsg:
+ @format: Message format 3gpp or 3gpp2
@sca: Service Center Address
@tpdu_length: Size of the array which is actual TPDU message
@tpdu_data: SMS TPDU message
Sends an SMS message to the networ
-->
<method name="SendMsg">
+ <arg direction="in" type="i" name="format"/>
<arg direction="in" type="v" name="sca"/>
<arg direction="in" type="i" name="tpdu_length"/>
<arg direction="in" type="v" name="tpdu_data"/>
<arg direction="out" type="i" name="result"/>
<arg direction="out" type="i" name="sim_index"/>
<arg direction="out" type="i" name="msg_status"/>
+ <arg direction="out" type="i" name="format"/>
<arg direction="out" type="v" name="sca"/>
<arg direction="out" type="i" name="tpdu_length"/>
<arg direction="out" type="v" name="tpdu_data"/>
Saves a message to SIM storage area.
-->
<method name="SaveMsg">
+ <arg direction="in" type="i" name="format"/>
<arg direction="in" type="i" name="msg_status"/>
<arg direction="in" type="v" name="sca"/>
<arg direction="in" type="i" name="tpdu_length"/>
GetCbConfig:
@result: Success(0)
@3gppType: Type of 3gpp, 0x01 . 3gpp. 0x02 . 3gpp2(CDMA)
- @cbEnable: CB service state. If cb_enabled is true then cell broadcast service will be enabled
+ @cbEnable: CB service state. If cb_enabled is true then cell broadcast service will be enabled
@msgIdMaxCount: CB Channel List Max Count
@msgIdCount: CB message ID count
@msgId: CB message ID information
<!--
GetPrefBearer:
+ @bearerType: the bearer type. PS_ONLY(1), CS_ONLY(2), PS_PREFERRED(3), CS_PREFERRED(4), NO_PREFERRED_BEARER(5)
@result: Success(0)
- Get SMS preferred bearer on which SMS has to be transmitted.
+ Get SMS preferred bearer on which SMS is transmitted.
-->
<method name="GetPrefBearer">
<arg direction="out" type="i" name="result"/>
+ <arg direction="out" type="i" name="bearerType"/>
</method>
<!--
Send a delivery report for the received incoming SMS to the network.
-->
<method name="SetDeliveryReport">
- <arg direction="in" type="v" name="sca"/>
+ <arg direction="in" type="i" name="format"/>
+ <arg direction="in" type="s" name="sca"/>
<arg direction="in" type="i" name="tpdu_length"/>
- <arg direction="in" type="v" name="tpdu_data"/>
+ <arg direction="in" type="s" name="tpdu_data"/>
<arg direction="in" type="i" name="rpCause"/>
<arg direction="out" type="i" name="result"/>
</method>
@destAddr_DialNumLen: TP-DA(TP-destination address). length of address. If Service center address is not set, then this will be zero
@destAddr_Ton: TP-DA, Type of number
@destAddr_Npi: TP-DA, Numbering plan identification
- @destAddr_DiallingNum: TP-DA, destination address. If Address not set, then set to 0xFF
+ @destAddr_DiallingNum: TP-DA, destination address. If Address not set, then set to 0xFF
@svcCntrAddr_DialNumLen: TP-service center address. length of address
@SvcCntrAddr_Ton: TP-service center address. Type of number
@svcCntrAddr_Npi: TP-service center address. Numbering plan identification
@destAddr_DialNumLen: TP-DA(TP-destination address). length of address. If Service center address is not set, then this will be zero
@destAddr_Ton: TP-DA, Type of number
@destAddr_Npi: TP-DA, Numbering plan identification
- @destAddr_DiallingNum: TP-DA, destination address. If Address not set, then set to 0xFF
+ @destAddr_DiallingNum: TP-DA, destination address. If Address not set, then set to 0xFF
@svcCntrAddr_DialNumLen: TP-service center address. length of address
@SvcCntrAddr_Ton: TP-service center address. Type of number
@svcCntrAddr_Npi: TP-service center address. Numbering plan identification
<!--
IncommingMsg:
+ @format: Message format 3gpp or 3gpp2
@sca: Service Center Address
- @msgLength: Size of the array which is actual TPDU message
- @tpdu: SMS TPDU message
+ @msgLength: Size of the array which is actual 3GPP and 3GPP2 TPDU message
+ @tpdu: SMS TPDU 3GPP and 3GPP2 message
This is an unsolicited Incoming SMS Event
-->
<signal name="IncommingMsg">
- <arg type="v" name="sca"/>
+ <arg type="i" name="format"/>
+ <arg type="s" name="sca"/>
<arg type="i" name="msgLength"/>
- <arg type="v" name="tpdu"/>
+ <arg type="s" name="tpdu"/>
</signal>
<!--
IncommingCbMsg:
@cbMsgType: Cell Broadcast message type. CBS(1), SCHEDULE(2), CBS41(3), INVALID(4)
@msgLength: Size of the array which is actual TPDU message
- @tpdu: Cell broadcast message data[Refer 3GPP TS 23.041 9.4.1
+ @tpdu: Cell broadcast message data for both 3GPP and 3GPP2
+ [GSM: Refer 3GPP TS 23.041 9.4.1]
+ [CDMA:Refer 3GPP2 C.S0015-A section 3.4.2.2]
This is an unsolicited Incoming cell broadcast message
-->
<signal name="IncommingCbMsg">
<arg type="i" name="cbMsgType"/>
<arg type="i" name="msgLength"/>
- <arg type="v" name="tpdu"/>
+ <arg type="s" name="tpdu"/>
</signal>
<!--
SmsReady:
@status: Ready indication
- SMS Ready indication
+ SMS Ready indication
-->
+
<signal name="SmsReady">
- <arg type="b" name="status"/>
+ <arg type="i" name="status"/>
</signal>
</interface>
%define major 0
-%define minor 3
-%define patchlevel 49
+%define minor 5
+%define patchlevel 5
Name: tel-plugin-dbus_tapi
Version: %{major}.%{minor}.%{patchlevel}
-Release: 5
+Release: 2
License: Apache-2.0
Summary: dbus-tapi plugin for telephony
Group: System/Libraries
BuildRequires: python-xml
BuildRequires: python
BuildRequires: pkgconfig(appsvc)
+BuildRequires: pkgconfig(capi-appfw-app-manager)
BuildRequires: pkgconfig(aul)
BuildRequires: pkgconfig(gio-2.0)
BuildRequires: pkgconfig(gio-unix-2.0)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(libxml-2.0)
-BuildRequires: pkgconfig(pkgmgr)
BuildRequires: pkgconfig(security-server)
BuildRequires: pkgconfig(tcore)
%build
versionint=$[%{major} * 1000000 + %{minor} * 1000 + %{patchlevel}]
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DVERSION=$versionint -DSYSCONFDIR=%{_sysconfdir} \
- -DBOARD_PLATFORM_SPREADTRUM=1
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DVERSION=$versionint \
make %{?_smp_mflags}
%files
%manifest tel-plugin-dbus_tapi.manifest
-%defattr(-,root,root,-)
+%defattr(644,system,system,-)
#%doc COPYING
%{_libdir}/telephony/plugins/*
%{_datadir}/license/tel-plugin-dbus_tapi
+++ /dev/null
-/*
- * tel-plugin-dbus-tapi
- *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <pthread.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <time.h>
-#include <glib.h>
-#include <gio/gio.h>
-
-#include <aul.h>
-#include <appsvc.h>
-#include <bundle.h>
-#include <tcore.h>
-#include <plugin.h>
-#include <server.h>
-#include <storage.h>
-#include <user_request.h>
-#include <core_object.h>
-#include <co_call.h>
-#include <communicator.h>
-
-#include "generated-code.h"
-#include "common.h"
-
-
-static void _launch_voice_call( struct tnoti_call_status_incoming* incoming, enum dbus_tapi_sim_slot_id slot_id )
-{
- char id[2] = {0, };
- char cli[2] = {0, };
- char clicause[3] = {0, };
- char forward[2] = {0, };
- char active_line[2] = {0, };
- char cna[2] = {0, };
- char number[83] = {0, };
- char name[83] = {0, };
- char slot_info[2] = {0,};
-
- bundle *kb = 0;
-
- snprintf( id, 2, "%d", incoming->id );
- dbg("id : [%s]", id );
- snprintf( cli, 2, "%d", incoming->cli.mode );
- dbg("cli : [%s]", cli );
- snprintf( clicause, 3, "%d", incoming->cli.no_cli_cause );
- dbg("clicause : [%s]", clicause );
- snprintf( number, 83, "%s", incoming->cli.number );
- dbg("number : [%s]", number );
- snprintf( forward, 2, "%d", incoming->forward );
- dbg("forward : [%s]", forward );
- snprintf( active_line, 2, "%d", incoming->active_line );
- dbg("active_line : [%s]", active_line );
-
- if ( incoming->cna.mode == CALL_CNA_MODE_PRESENT )
- snprintf( cna, 2, "%d", 0 );
- else
- snprintf( cna, 2, "%d", 1 );
-
- dbg("cna : [%s]", cna );
- snprintf( name, 83, "%s", incoming->cna.name );
- dbg("name : [%s]", name );
-
- snprintf(slot_info, 2, "%d", slot_id);
- dbg("slot_id : [%s]", slot_info);
-
-
- kb = bundle_create();
-
- /* AppSvc */
- appsvc_set_operation(kb, APPSVC_OPERATION_CALL);
- appsvc_set_uri(kb,"tel:MT");
-
- appsvc_add_data(kb, "launch-type", "MT");
- appsvc_add_data(kb, "handle", id);
- appsvc_add_data(kb, "number", number);
- appsvc_add_data(kb, "name_mode", cna);
- appsvc_add_data(kb, "name", name);
- appsvc_add_data(kb, "cli", cli);
- appsvc_add_data(kb, "clicause", clicause);
- appsvc_add_data(kb, "fwded", forward);
- appsvc_add_data(kb, "activeline", active_line);
- appsvc_add_data(kb, "slot_id", slot_info);
-
- appsvc_run_service(kb, 0, NULL, NULL);
- bundle_free(kb);
-}
-
-static void _launch_video_call( struct tnoti_call_status_incoming* incoming, enum dbus_tapi_sim_slot_id slot_id)
-{
- char id[2] = {0, };
- char cli[2] = {0, };
- char forward[2] = {0, };
- char number[83] = {0, };
- char slot_info[2] = {0,};
- int ret = 0;
-
- bundle *kb = 0;
-
- dbg("Func Entrance");
-
- snprintf( id, 2, "%d", incoming->id );
- dbg("id : [%s]", id );
- snprintf( number, 83, "%s", incoming->cli.number );
- dbg("number : [%s]", number );
- snprintf( cli, 2, "%d", incoming->cli.mode );
- dbg("cli : [%s]", id );
- snprintf( forward, 2, "%d", incoming->forward );
- dbg("forward : [%s]", forward );
-
- snprintf(slot_info, 2, "%d", slot_id);
- dbg("slot_id : [%s]", slot_info);
-
- kb = bundle_create();
- bundle_add(kb, "KEY_CALL_TYPE", "mt");
- bundle_add(kb, "KEY_CALL_HANDLE", id);
- bundle_add(kb, "KEY_CALLING_PARTY_NUMBER", number);
- bundle_add(kb, "KEY_CLI_CAUSE", cli);
- bundle_add(kb, "KEY_FORWARDED", forward);
- bundle_add(kb, "KEY_SLOT_ID", slot_info);
-
-
- ret = aul_launch_app("org.tizen.vtmain", kb);
- bundle_free(kb);
-
- dbg("VT AUL return %d",ret);
-}
-
-static gboolean on_call_dial(TelephonyCall *call, GDBusMethodInvocation *invocation, gint call_type, gint call_ecc, gchar* call_number, gpointer user_data)
-{
- struct treq_call_dial req;
- struct custom_data *ctx = user_data;
- UserRequest *ur;
- TReturn ret = 0;
-
- memset(&req, 0x0,sizeof(req));
-
- if (!check_access_control (invocation, AC_CALL, "x"))
- return TRUE;
-
- ur = MAKE_UR(ctx, call, invocation);
-
- req.type = call_type;
- req.ecc = call_ecc;
-
- if ( call_number ){
- g_strlcpy( req.number, call_number, MAX_CALL_DIAL_NUM_LEN);
- }
-
- dbg("dial len : %d, dial str : %s", strlen(req.number), req.number);
-
- tcore_user_request_set_data( ur, sizeof( struct treq_call_dial ), &req );
- tcore_user_request_set_command( ur, TREQ_CALL_DIAL );
-
- ret = tcore_communicator_dispatch_request( ctx->comm, ur );
- if ( ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_call_answer(TelephonyCall *call, GDBusMethodInvocation *invocation, gint call_id, gint answer_type, gpointer user_data)
-{
- struct treq_call_answer req;
- struct custom_data *ctx = user_data;
- UserRequest *ur;
- TReturn ret = 0;
-
- if (!check_access_control (invocation, AC_CALL, "x"))
- return TRUE;
-
- ur = MAKE_UR(ctx, call, invocation);
-
- req.id = call_id;
- req.type = answer_type;
-
- tcore_user_request_set_data( ur, sizeof( struct treq_call_answer ), &req );
- tcore_user_request_set_command( ur, TREQ_CALL_ANSWER );
-
- ret = tcore_communicator_dispatch_request( ctx->comm, ur );
- if ( ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_call_end(TelephonyCall *call, GDBusMethodInvocation *invocation, gint call_id, gint end_type, gpointer user_data)
-{
- struct treq_call_end req;
- struct custom_data *ctx = user_data;
- UserRequest *ur;
- TReturn ret = 0;
-
- if (!check_access_control (invocation, AC_CALL, "x"))
- return TRUE;
-
- ur = MAKE_UR(ctx, call, invocation);
-
- req.id = call_id;
- req.type = end_type;
-
- tcore_user_request_set_data( ur, sizeof( struct treq_call_end ), &req );
- tcore_user_request_set_command( ur, TREQ_CALL_END );
-
- ret = tcore_communicator_dispatch_request( ctx->comm, ur );
- if ( ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_call_start_cont_dtmf(TelephonyCall *call, GDBusMethodInvocation *invocation, guchar dtmf_digit, gpointer user_data)
-{
- struct treq_call_start_cont_dtmf req;
- struct custom_data *ctx = user_data;
- UserRequest *ur;
- TReturn ret = 0;
-
- if (!check_access_control (invocation, AC_CALL, "x"))
- return TRUE;
-
- ur = MAKE_UR(ctx, call, invocation);
- memset(&req, 0x0,sizeof(req));
-
- req.dtmf_digit = dtmf_digit;
-
- tcore_user_request_set_data( ur, sizeof( struct treq_call_start_cont_dtmf ), &req );
- tcore_user_request_set_command( ur, TREQ_CALL_START_CONT_DTMF );
-
- ret = tcore_communicator_dispatch_request( ctx->comm, ur );
- if ( ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_call_stop_cont_dtmf(TelephonyCall *call, GDBusMethodInvocation *invocation, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur;
- TReturn ret = 0;
-
- if (!check_access_control (invocation, AC_CALL, "x"))
- return TRUE;
-
- ur = MAKE_UR(ctx, call, invocation);
-
- tcore_user_request_set_command( ur, TREQ_CALL_STOP_CONT_DTMF );
-
- ret = tcore_communicator_dispatch_request( ctx->comm, ur );
- if ( ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_call_send_burst_dtmf(TelephonyCall *call, GDBusMethodInvocation *invocation, gchar *dtmf_string, gint pulse_width, gint inter_digit_interval, gpointer user_data)
-{
- struct treq_call_send_burst_dtmf req;
- struct custom_data *ctx = user_data;
- UserRequest *ur;
- TReturn ret = 0;
-
- if (!check_access_control (invocation, AC_CALL, "x"))
- return TRUE;
-
- ur = MAKE_UR(ctx, call, invocation);
- memset(&req, 0x0,sizeof(req));
- if ( dtmf_string ) {
- g_strlcpy( req.dtmf_string, dtmf_string, MAX_CALL_BURST_DTMF_STRING_LEN +1 );
- }
- else {
- FAIL_RESPONSE (invocation, "Invalid Input");
- err("Invalid DTMF string" );
- tcore_user_request_unref(ur);
- return TRUE;
- }
-
-
- req.pulse_width = pulse_width;
- req.inter_digit_interval = inter_digit_interval;
-
- tcore_user_request_set_data( ur, sizeof( struct treq_call_send_burst_dtmf ), &req );
- tcore_user_request_set_command( ur, TREQ_CALL_SEND_BURST_DTMF );
-
- ret = tcore_communicator_dispatch_request( ctx->comm, ur );
- if ( ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- err("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_call_active(TelephonyCall *call, GDBusMethodInvocation *invocation, gint call_id, gpointer user_data)
-{
- struct treq_call_active req;
- struct custom_data *ctx = user_data;
- UserRequest *ur;
- TReturn ret = 0;
-
- if (!check_access_control (invocation, AC_CALL, "x"))
- return TRUE;
-
- ur = MAKE_UR(ctx, call, invocation);
-
- req.id = call_id;
-
- tcore_user_request_set_data( ur, sizeof( struct treq_call_active ), &req );
- tcore_user_request_set_command( ur, TREQ_CALL_ACTIVE );
-
- ret = tcore_communicator_dispatch_request( ctx->comm, ur );
- if ( ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_call_hold(TelephonyCall *call, GDBusMethodInvocation *invocation, gint call_id, gpointer user_data)
-{
- struct treq_call_hold req;
- struct custom_data *ctx = user_data;
- UserRequest *ur;
- TReturn ret = 0;
-
- if (!check_access_control (invocation, AC_CALL, "x"))
- return TRUE;
-
- ur = MAKE_UR(ctx, call, invocation);
-
- req.id = call_id;
-
- tcore_user_request_set_data( ur, sizeof( struct treq_call_hold ), &req );
- tcore_user_request_set_command( ur, TREQ_CALL_HOLD );
-
- ret = tcore_communicator_dispatch_request( ctx->comm, ur );
- if ( ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_call_swap(TelephonyCall *call, GDBusMethodInvocation *invocation, gint call_id, gpointer user_data)
-{
- struct treq_call_swap req;
- struct custom_data *ctx = user_data;
- UserRequest *ur;
- TReturn ret = 0;
-
- if (!check_access_control (invocation, AC_CALL, "x"))
- return TRUE;
-
- ur = MAKE_UR(ctx, call, invocation);
-
- req.id = call_id;
-
- tcore_user_request_set_data( ur, sizeof( struct treq_call_swap ), &req );
- tcore_user_request_set_command( ur, TREQ_CALL_SWAP );
-
- ret = tcore_communicator_dispatch_request( ctx->comm, ur );
- if ( ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_call_join(TelephonyCall *call, GDBusMethodInvocation *invocation, gint call_id, gpointer user_data)
-{
- struct treq_call_join req;
- struct custom_data *ctx = user_data;
- UserRequest *ur;
- TReturn ret = 0;
-
- if (!check_access_control (invocation, AC_CALL, "x"))
- return TRUE;
-
- ur = MAKE_UR(ctx, call, invocation);
-
- req.id = call_id;
-
- tcore_user_request_set_data( ur, sizeof( struct treq_call_join ), &req );
- tcore_user_request_set_command( ur, TREQ_CALL_JOIN );
-
- ret = tcore_communicator_dispatch_request( ctx->comm, ur );
- if ( ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_call_split(TelephonyCall *call, GDBusMethodInvocation *invocation, gint call_id, gpointer user_data)
-{
- struct treq_call_split req;
- struct custom_data *ctx = user_data;
- UserRequest *ur;
- TReturn ret = 0;
-
- if (!check_access_control (invocation, AC_CALL, "x"))
- return TRUE;
-
- ur = MAKE_UR(ctx, call, invocation);
-
- req.id = call_id;
-
- tcore_user_request_set_data( ur, sizeof( struct treq_call_split ), &req );
- tcore_user_request_set_command( ur, TREQ_CALL_SPLIT );
-
- ret = tcore_communicator_dispatch_request( ctx->comm, ur );
- if ( ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_call_transfer(TelephonyCall *call, GDBusMethodInvocation *invocation, gint call_id, gpointer user_data)
-{
- struct treq_call_transfer req;
- struct custom_data *ctx = user_data;
- UserRequest *ur;
- TReturn ret = 0;
-
- if (!check_access_control (invocation, AC_CALL, "x"))
- return TRUE;
-
- ur = MAKE_UR(ctx, call, invocation);
-
- req.id = call_id;
-
- tcore_user_request_set_data( ur, sizeof( struct treq_call_transfer ), &req );
- tcore_user_request_set_command( ur, TREQ_CALL_TRANSFER );
-
- ret = tcore_communicator_dispatch_request( ctx->comm, ur );
- if ( ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_call_deflect(TelephonyCall *call, GDBusMethodInvocation *invocation, gchar *call_number, gpointer user_data)
-{
- struct treq_call_deflect req;
- struct custom_data *ctx = user_data;
- UserRequest *ur;
- TReturn ret = 0;
-
- if (!check_access_control (invocation, AC_CALL, "x"))
- return TRUE;
-
- ur = MAKE_UR(ctx, call, invocation);
-
- if ( call_number ){
- g_strlcpy( req.number, call_number, MAX_CALL_DIAL_NUM_LEN);
- }
-
- tcore_user_request_set_data( ur, sizeof( struct treq_call_deflect ), &req );
- tcore_user_request_set_command( ur, TREQ_CALL_DEFLECT );
-
- ret = tcore_communicator_dispatch_request( ctx->comm, ur );
- if ( ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_call_get_privacy_mode(TelephonyCall *call, GDBusMethodInvocation *invocation, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur;
- TReturn ret = 0;
-
- if (!check_access_control (invocation, AC_CALL, "r"))
- return TRUE;
-
- ur = MAKE_UR(ctx, call, invocation);
- tcore_user_request_set_command( ur, TREQ_CALL_GET_PRIVACY_MODE );
-
- ret = tcore_communicator_dispatch_request( ctx->comm, ur );
- if ( ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_call_set_privacy_mode(TelephonyCall *call, GDBusMethodInvocation *invocation, gint privacy_mode, gpointer user_data)
-{
- struct treq_call_set_voice_privacy_mode req;
- struct custom_data *ctx = user_data;
- UserRequest *ur;
- TReturn ret = 0;
-
- if (!check_access_control (invocation, AC_CALL, "w"))
- return TRUE;
-
- ur = MAKE_UR(ctx, call, invocation);
-
- req.privacy_mode = privacy_mode;
-
- tcore_user_request_set_data( ur, sizeof( struct treq_call_set_voice_privacy_mode ), &req );
- tcore_user_request_set_command( ur, TREQ_CALL_SET_PRIVACY_MODE );
-
- ret = tcore_communicator_dispatch_request( ctx->comm, ur );
- if ( ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_call_get_status(TelephonyCall *call, GDBusMethodInvocation *invocation, gint call_id, gpointer user_data )
-{
- struct custom_data *ctx = user_data;
- TcorePlugin *plugin = 0;
- GSList *o_list = 0;
- CoreObject *o = 0;
- CallObject *co = 0;
-
- gchar call_number[MAX_CALL_NUMBER_LEN];
- gint call_type;
- gboolean call_direction;
- gint call_status;
- gboolean call_multiparty_state;
-
- /* NOTE: Ignore access control */
-
- plugin = tcore_server_find_plugin(ctx->server, GET_CP_NAME(invocation));
-
- o_list = tcore_plugin_get_core_objects_bytype(plugin, CORE_OBJECT_TYPE_CALL);
- if ( !o_list ) {
- dbg("[ error ] co_list : 0");
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- return TRUE;
- }
-
- o = (CoreObject *)o_list->data;
- g_slist_free(o_list);
-
- co = tcore_call_object_find_by_id( o, call_id );
- if ( !co ) {
- dbg("[ error ] co : 0");
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- return TRUE;
- }
-
- memset( call_number, 0, MAX_CALL_NUMBER_LEN );
- tcore_call_object_get_number( co, call_number );
-
- call_type = tcore_call_object_get_type( co );
- call_direction = tcore_call_object_get_direction( co );
-
- if ( call_direction == TCORE_CALL_DIRECTION_OUTGOING ) {
- call_direction = TRUE;
- } else {
- call_direction = FALSE;
- }
-
- call_status = tcore_call_object_get_status( co );
- call_multiparty_state = tcore_call_object_get_multiparty_state( co );
-
-
- telephony_call_complete_get_status(call, invocation,
- call_id, call_number, call_type, call_direction, call_status, call_multiparty_state );
-
- return TRUE;
-}
-
-static gboolean on_call_get_status_all(TelephonyCall *call, GDBusMethodInvocation *invocation, gpointer user_data )
-{
- struct custom_data *ctx = user_data;
- TcorePlugin *plugin = 0;
- GSList *list = 0;
- CoreObject *o = 0;
- CallObject *co = 0;
-
- GVariant *gv = 0;
- GVariantBuilder b;
-
- gint call_id;
- gchar call_number[MAX_CALL_NUMBER_LEN];
- gint call_type;
- gboolean call_direction;
- gint call_status;
- gboolean call_multiparty_state;
-
- int len, i;
-
- if (!check_access_control (invocation, AC_CALL, "r"))
- return TRUE;
-
- plugin = tcore_server_find_plugin(ctx->server, GET_CP_NAME(invocation));
-
- list = tcore_plugin_get_core_objects_bytype(plugin, CORE_OBJECT_TYPE_CALL);
- if ( !list ) {
- dbg("[ error ] co_list : 0");
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- return TRUE;
- }
-
- o = (CoreObject *)list->data;
- g_slist_free(list);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
-#define MAX_CALL_STATUS_NUM 7
- for ( i=0; i<MAX_CALL_STATUS_NUM; i++ ) {
- list = tcore_call_object_find_by_status( o, i );
-
- if ( list ) {
-
- GSList *tmp = 0;
- tmp = list;
-
- dbg("[ check ] there is a call on state %s", i== TCORE_CALL_STATUS_IDLE?"(IDLE)":
- (i== TCORE_CALL_STATUS_ACTIVE?"(ACTIVE)":
- (i== TCORE_CALL_STATUS_HELD?"(HELD)":
- (i== TCORE_CALL_STATUS_DIALING?"(DIALING)":
- (i== TCORE_CALL_STATUS_ALERT?"(ALERT)":
- (i== TCORE_CALL_STATUS_INCOMING?"(INCOMING)":
- (i== TCORE_CALL_STATUS_WAITING?"(WAITING)":"(UNKNOWN)")))))));
-
- while ( tmp ) {
-
- co = (CallObject*)tmp->data;
- if ( !co ) {
- dbg("[ error ] call object : 0");
- tmp = tmp->next;
- continue;
- }
-
- call_id = tcore_call_object_get_id( co );
-
- memset( call_number, 0, MAX_CALL_NUMBER_LEN );
- len = tcore_call_object_get_number( co, call_number );
-
- call_type = tcore_call_object_get_type( co );
- call_direction = tcore_call_object_get_direction( co );
-
- if ( call_direction == TCORE_CALL_DIRECTION_OUTGOING ) {
- call_direction = TRUE;
- } else {
- call_direction = FALSE;
- }
-
- call_status = tcore_call_object_get_status( co );
- call_multiparty_state = tcore_call_object_get_multiparty_state( co );
-
- dbg("call_id : %d", call_id);
- dbg("call_number_len : %d", len);
- dbg("call_number : \"%s\"", call_number);
- dbg("call_type : %s (%d)", call_type==TCORE_CALL_TYPE_VOICE?"VOICE":
- (call_type==TCORE_CALL_TYPE_VIDEO?"VIDEO":
- (call_type==TCORE_CALL_TYPE_E911?"E911":
- (call_type==TCORE_CALL_TYPE_STDOTASP?"STDOTASP":
- (call_type==TCORE_CALL_TYPE_NONSTDOTASP?"NONSTDOTASP":"UNKNOWN")))), call_type);
- dbg("call_direction : %s (%d)", call_direction==TRUE?"MO":"MT", call_direction);
- dbg("call_status : %s (%d)", call_status== TCORE_CALL_STATUS_IDLE?"IDLE":
- (call_status== TCORE_CALL_STATUS_ACTIVE?"ACTIVE":
- (call_status== TCORE_CALL_STATUS_HELD?"HELD":
- (call_status== TCORE_CALL_STATUS_DIALING?"DIALING":
- (call_status== TCORE_CALL_STATUS_ALERT?"ALERT":
- (call_status== TCORE_CALL_STATUS_INCOMING?"INCOMING":
- (call_status== TCORE_CALL_STATUS_WAITING?"WAITING":"UNKNOWN")))))), call_status);
- dbg("call_multiparty_state : %s (%d)", call_multiparty_state ==1?"T":"F", call_multiparty_state);
-
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "call_id", g_variant_new_int32( call_id ));
- g_variant_builder_add(&b, "{sv}", "call_number", g_variant_new_string( call_number ));
- g_variant_builder_add(&b, "{sv}", "call_type", g_variant_new_int32( call_type ));
- g_variant_builder_add(&b, "{sv}", "call_direction", g_variant_new_boolean( call_direction ));
- g_variant_builder_add(&b, "{sv}", "call_state", g_variant_new_int32( call_status ));
- g_variant_builder_add(&b, "{sv}", "call_multiparty_state", g_variant_new_boolean( call_multiparty_state ));
- g_variant_builder_close(&b);
-
- tmp = g_slist_next( tmp );
- }
- g_slist_free(list);
- } else {
- dbg("[ check ] there is no call on state %s", i== TCORE_CALL_STATUS_IDLE?"(IDLE)":
- (i== TCORE_CALL_STATUS_ACTIVE?"(ACTIVE)":
- (i== TCORE_CALL_STATUS_HELD?"(HELD)":
- (i== TCORE_CALL_STATUS_DIALING?"(DIALING)":
- (i== TCORE_CALL_STATUS_ALERT?"(ALERT)":
- (i== TCORE_CALL_STATUS_INCOMING?"(INCOMING)":
- (i== TCORE_CALL_STATUS_WAITING?"(WAITING)":"(UNKNOWN)")))))));
- }
-
- }
-
- gv = g_variant_builder_end(&b);
-
- telephony_call_complete_get_status_all(call, invocation, gv);
-
- return TRUE;
-}
-
-static gboolean on_call_set_sound_path(TelephonyCall *call, GDBusMethodInvocation *invocation, gint sound_path, gboolean extra_volume_on, gpointer user_data)
-{
- struct treq_call_set_sound_path req;
- struct custom_data *ctx = user_data;
- UserRequest *ur;
- TReturn ret = 0;
-
- if (!check_access_control (invocation, AC_CALL, "w"))
- return TRUE;
-
- ur = MAKE_UR(ctx, call, invocation);
-
- req.path = sound_path;
- req.extra_volume_on = extra_volume_on;
-
- tcore_user_request_set_data( ur, sizeof( struct treq_call_set_sound_path ), &req );
- tcore_user_request_set_command( ur, TREQ_CALL_SET_SOUND_PATH );
-
- ret = tcore_communicator_dispatch_request( ctx->comm, ur );
- if ( ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_call_get_sound_volume_level(TelephonyCall *call, GDBusMethodInvocation *invocation, gint sound_device, gint sound_type, gpointer user_data)
-{
- struct treq_call_get_sound_volume_level req;
- struct custom_data *ctx = user_data;
- UserRequest *ur;
- TReturn ret = 0;
-
- if (!check_access_control (invocation, AC_CALL, "r"))
- return TRUE;
-
- ur = MAKE_UR(ctx, call, invocation);
-
- req.device = sound_device;
- req.sound = sound_type;
-
- tcore_user_request_set_data( ur, sizeof( struct treq_call_get_sound_volume_level ), &req );
- tcore_user_request_set_command( ur, TREQ_CALL_GET_SOUND_VOLUME_LEVEL );
-
- ret = tcore_communicator_dispatch_request( ctx->comm, ur );
- if ( ret != TCORE_RETURN_SUCCESS ) {
-
- GVariantBuilder b;
- GVariant *result = 0;
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "err", g_variant_new_int32(ret));
- g_variant_builder_close(&b);
- result = g_variant_builder_end(&b);
-
- telephony_call_complete_get_sound_volume_level(call, invocation, result, ret );
-
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- return FALSE;
- }
-
- return TRUE;
-}
-
-static gboolean on_call_set_sound_volume_level(TelephonyCall *call, GDBusMethodInvocation *invocation, gint sound_device, gint sound_type, gint sound_volume, gpointer user_data)
-{
- struct treq_call_set_sound_volume_level req;
- struct custom_data *ctx = user_data;
- UserRequest *ur;
- TReturn ret = 0;
-
- if (!check_access_control (invocation, AC_CALL, "w"))
- return TRUE;
-
- ur = MAKE_UR(ctx, call, invocation);
-
- req.device = sound_device;
- req.sound = sound_type;
- req.volume = sound_volume;
-
- tcore_user_request_set_data( ur, sizeof( struct treq_call_set_sound_volume_level ), &req );
- tcore_user_request_set_command( ur, TREQ_CALL_SET_SOUND_VOLUME_LEVEL );
-
- ret = tcore_communicator_dispatch_request( ctx->comm, ur );
- if ( ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_call_get_sound_mute_status(TelephonyCall *call, GDBusMethodInvocation *invocation, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur;
- TReturn ret = 0;
-
- if (!check_access_control (invocation, AC_CALL, "r"))
- return TRUE;
-
- ur = MAKE_UR(ctx, call, invocation);
-
- tcore_user_request_set_command( ur, TREQ_CALL_GET_SOUND_MUTE_STATUS );
-
- ret = tcore_communicator_dispatch_request( ctx->comm, ur );
- if ( ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_call_set_sound_mute_status(TelephonyCall *call, GDBusMethodInvocation *invocation, gint status, gint path, gpointer user_data)
-{
- struct treq_call_set_sound_mute_status req;
- struct custom_data *ctx = user_data;
- UserRequest *ur;
- TReturn ret = 0;
-
- if (!check_access_control (invocation, AC_CALL, "w"))
- return TRUE;
-
- ur = MAKE_UR(ctx, call, invocation);
-
- req.path = path;
- req.status = status;
-
- dbg("[ check ] path : 0x%x, status : 0x%x", path, status);
-
- tcore_user_request_set_data( ur, sizeof( struct treq_call_set_sound_mute_status ), &req );
- tcore_user_request_set_command( ur, TREQ_CALL_SET_SOUND_MUTE_STATUS );
-
- ret = tcore_communicator_dispatch_request( ctx->comm, ur );
- if ( ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_call_set_sound_recording(TelephonyCall *call, GDBusMethodInvocation *invocation, gint recording_state, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- struct treq_call_set_sound_recording req;
- UserRequest *ur;
- TReturn ret = 0;
-
- if (!check_access_control (invocation, AC_CALL, "w"))
- return TRUE;
-
- ur = MAKE_UR(ctx, call, invocation);
-
- req.state = (gboolean)recording_state;
-
- tcore_user_request_set_data( ur, sizeof( struct treq_call_set_sound_recording ), &req );
- tcore_user_request_set_command( ur, TREQ_CALL_SET_SOUND_RECORDING );
-
- ret = tcore_communicator_dispatch_request( ctx->comm, ur );
- if ( ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_call_set_sound_equalization(TelephonyCall *call, GDBusMethodInvocation *invocation, gint eq_mode, gint eq_direction, gchar* eq_parameter, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- struct treq_call_set_sound_equalization req;
- UserRequest *ur;
- TReturn ret = 0;
-
- if (!check_access_control (invocation, AC_CALL, "w"))
- return TRUE;
-
- ur = MAKE_UR(ctx, call, invocation);
-
- req.mode = eq_mode;
- req.direction = (enum telephony_call_sound_direction)eq_direction;
- memcpy( (char*)req.parameter, (const char*)eq_parameter, (MAX_CALL_EQ_PARAMETER_SIZE*2) );
-
- tcore_user_request_set_data( ur, sizeof( struct treq_call_set_sound_equalization ), &req );
- tcore_user_request_set_command( ur, TREQ_CALL_SET_SOUND_EQUALIZATION );
-
- ret = tcore_communicator_dispatch_request( ctx->comm, ur );
- if ( ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_call_set_sound_noise_reduction(TelephonyCall *call, GDBusMethodInvocation *invocation, gint nr_state, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- struct treq_call_set_sound_noise_reduction req;
- UserRequest *ur;
- TReturn ret = 0;
-
- if (!check_access_control (invocation, AC_CALL, "w"))
- return TRUE;
-
- ur = MAKE_UR(ctx, call, invocation);
-
- req.status = (gboolean)nr_state;
-
- tcore_user_request_set_data( ur, sizeof( struct treq_call_set_sound_noise_reduction ), &req );
- tcore_user_request_set_command( ur, TREQ_CALL_SET_SOUND_NOISE_REDUCTION );
-
- ret = tcore_communicator_dispatch_request( ctx->comm, ur );
- if ( ret != TCORE_RETURN_SUCCESS ) {
- telephony_call_complete_set_sound_noise_reduction(call, invocation, ret );
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- return FALSE;
- }
-
- return TRUE;
-}
-
-static gboolean on_call_set_sound_clock_status(TelephonyCall *call, GDBusMethodInvocation *invocation, gboolean clock_status, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- struct treq_call_set_sound_clock_status req;
- UserRequest *ur;
- TReturn ret = 0;
-
- if (!check_access_control (invocation, AC_CALL, "w"))
- return TRUE;
-
- ur = MAKE_UR(ctx, call, invocation);
-
- req.status = clock_status;
-
- tcore_user_request_set_data( ur, sizeof( struct treq_call_set_sound_clock_status ), &req );
- tcore_user_request_set_command( ur, TREQ_CALL_SET_SOUND_CLOCK_STATUS );
-
- ret = tcore_communicator_dispatch_request( ctx->comm, ur );
- if ( ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_call_set_preferred_voice_subscription(TelephonyCall *call, GDBusMethodInvocation *invocation,
- gint preferred_subscription, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- struct treq_call_set_preferred_voice_subscription req;
- UserRequest *ur;
- TReturn ret = 0;
-
- if (!check_access_control (invocation, AC_CALL, "w"))
- return TRUE;
-
- ur = MAKE_UR(ctx, call, invocation);
-
- req.preferred_subs = preferred_subscription;
-
- tcore_user_request_set_data( ur, sizeof( struct treq_call_set_preferred_voice_subscription ), &req );
- tcore_user_request_set_command( ur, TREQ_CALL_SET_PREFERRED_VOICE_SUBSCRIPTION );
-
- ret = tcore_communicator_dispatch_request( ctx->comm, ur );
- if ( ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_call_get_preferred_voice_subscription(TelephonyCall *call, GDBusMethodInvocation *invocation, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur;
- TReturn ret = 0;
-
- if (!check_access_control (invocation, AC_CALL, "r"))
- return TRUE;
-
- ur = MAKE_UR(ctx, call, invocation);
-
- tcore_user_request_set_command( ur, TREQ_CALL_GET_PREFERRED_VOICE_SUBSCRIPTION );
-
- ret = tcore_communicator_dispatch_request( ctx->comm, ur );
- if ( ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-gboolean dbus_plugin_setup_call_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx)
-{
- TelephonyCall *call;
-
- call = telephony_call_skeleton_new();
- telephony_object_skeleton_set_call(object, call);
- g_object_unref(call);
-
- g_signal_connect (call,
- "handle-dial",
- G_CALLBACK (on_call_dial),
- ctx);
-
- g_signal_connect (call,
- "handle-answer",
- G_CALLBACK (on_call_answer),
- ctx);
-
- g_signal_connect (call,
- "handle-end",
- G_CALLBACK (on_call_end),
- ctx);
-
- g_signal_connect (call,
- "handle-start-cont-dtmf",
- G_CALLBACK (on_call_start_cont_dtmf),
- ctx);
-
- g_signal_connect (call,
- "handle-stop-cont-dtmf",
- G_CALLBACK (on_call_stop_cont_dtmf),
- ctx);
-
- g_signal_connect (call,
- "handle-send-burst-dtmf",
- G_CALLBACK (on_call_send_burst_dtmf),
- ctx);
-
- g_signal_connect (call,
- "handle-active",
- G_CALLBACK (on_call_active),
- ctx);
-
- g_signal_connect (call,
- "handle-hold",
- G_CALLBACK (on_call_hold),
- ctx);
-
- g_signal_connect (call,
- "handle-swap",
- G_CALLBACK (on_call_swap),
- ctx);
-
- g_signal_connect (call,
- "handle-join",
- G_CALLBACK (on_call_join),
- ctx);
-
- g_signal_connect (call,
- "handle-split",
- G_CALLBACK (on_call_split),
- ctx);
-
- g_signal_connect (call,
- "handle-transfer",
- G_CALLBACK (on_call_transfer),
- ctx);
-
- g_signal_connect (call,
- "handle-deflect",
- G_CALLBACK (on_call_deflect),
- ctx);
-
- g_signal_connect (call,
- "handle-get-privacy-mode",
- G_CALLBACK (on_call_get_privacy_mode),
- ctx);
-
- g_signal_connect (call,
- "handle-set-privacy-mode",
- G_CALLBACK (on_call_set_privacy_mode),
- ctx);
-
- g_signal_connect (call,
- "handle-get-status",
- G_CALLBACK (on_call_get_status),
- ctx);
-
- g_signal_connect (call,
- "handle-get-status-all",
- G_CALLBACK (on_call_get_status_all),
- ctx);
-
-
- g_signal_connect (call,
- "handle-set-sound-path",
- G_CALLBACK (on_call_set_sound_path),
- ctx);
-
- g_signal_connect (call,
- "handle-get-sound-volume-level",
- G_CALLBACK (on_call_get_sound_volume_level),
- ctx);
-
- g_signal_connect (call,
- "handle-set-sound-volume-level",
- G_CALLBACK (on_call_set_sound_volume_level),
- ctx);
-
- g_signal_connect (call,
- "handle-get-sound-mute-status",
- G_CALLBACK (on_call_get_sound_mute_status),
- ctx);
-
- g_signal_connect (call,
- "handle-set-sound-mute-status",
- G_CALLBACK (on_call_set_sound_mute_status),
- ctx);
-
- g_signal_connect (call,
- "handle-set-sound-recording",
- G_CALLBACK (on_call_set_sound_recording),
- ctx);
-
- g_signal_connect (call,
- "handle-set-sound-equalization",
- G_CALLBACK (on_call_set_sound_equalization),
- ctx);
-
- g_signal_connect (call,
- "handle-set-sound-noise-reduction",
- G_CALLBACK (on_call_set_sound_noise_reduction),
- ctx);
-
- g_signal_connect (call,
- "handle-set-sound-clock-status",
- G_CALLBACK (on_call_set_sound_clock_status),
- ctx);
-
- g_signal_connect (call,
- "handle-set-preferred-voice-subscription",
- G_CALLBACK (on_call_set_preferred_voice_subscription),
- ctx);
-
- g_signal_connect (call,
- "handle-get-preferred-voice-subscription",
- G_CALLBACK (on_call_get_preferred_voice_subscription),
- ctx);
-
- return TRUE;
-}
-
-gboolean dbus_plugin_call_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data)
-{
- int i = 0;
- GSList *co_list;
- CoreObject *co_call;
- char *modem_name = NULL;
- TcorePlugin *p = NULL;
-
- modem_name = tcore_user_request_get_modem_name(ur);
- if (!modem_name)
- return FALSE;
-
- p = tcore_server_find_plugin(ctx->server, modem_name);
- free(modem_name);
- if (!p)
- return FALSE;
-
- co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_CALL);
- if (!co_list) {
- return FALSE;
- }
-
- co_call = (CoreObject *)co_list->data;
- g_slist_free(co_list);
-
- if (!co_call) {
- return FALSE;
- }
-
- switch (command) {
- case TRESP_CALL_DIAL: {
- struct tresp_call_dial *resp = (struct tresp_call_dial*)data;
-
- dbg("receive TRESP_CALL_DIAL (err[%d])", resp->err);
-
- telephony_call_complete_dial(dbus_info->interface_object, dbus_info->invocation, resp->err);
- } break;
-
- case TRESP_CALL_ANSWER: {
- struct tresp_call_answer *resp = (struct tresp_call_answer*)data;
-
- dbg("receive TRESP_CALL_ANSWER (err[%d] id[%d])", resp->err, resp->id);
-
- telephony_call_complete_answer(dbus_info->interface_object, dbus_info->invocation, resp->err, resp->id );
-
- } break;
-
- case TRESP_CALL_END: {
- struct tresp_call_end *resp = (struct tresp_call_end*)data;
-
- dbg("receive TRESP_CALL_END (err[%d] id[%d] type[%d])", resp->err, resp->id, resp->type);
-
- telephony_call_complete_end(dbus_info->interface_object, dbus_info->invocation, resp->err, resp->id, resp->type );
-
- } break;
-
- case TRESP_CALL_HOLD: {
- struct tresp_call_hold *resp = (struct tresp_call_hold*)data;
-
- dbg("receive TRESP_CALL_HOLD (err[%d] id[%d])", resp->err, resp->id);
-
- telephony_call_complete_hold(dbus_info->interface_object, dbus_info->invocation, resp->err, resp->id );
-
- } break;
-
- case TRESP_CALL_ACTIVE: {
- struct tresp_call_active *resp = (struct tresp_call_active*)data;
-
- dbg("receive TRESP_CALL_ACTIVE (err[%d] id[%d])", resp->err, resp->id);
-
- telephony_call_complete_active(dbus_info->interface_object, dbus_info->invocation, resp->err, resp->id );
-
- } break;
-
- case TRESP_CALL_SWAP: {
- struct tresp_call_swap *resp = (struct tresp_call_swap*)data;
-
- dbg("receive TRESP_CALL_SWAP (err[%d] id[%d])", resp->err, resp->id);
-
- telephony_call_complete_swap(dbus_info->interface_object, dbus_info->invocation, resp->err, resp->id );
-
- } break;
-
- case TRESP_CALL_JOIN: {
- struct tresp_call_join *resp = (struct tresp_call_join*)data;
-
- dbg("receive TRESP_CALL_JOIN (err[%d] id[%d])", resp->err, resp->id);
-
- telephony_call_complete_join(dbus_info->interface_object, dbus_info->invocation, resp->err, resp->id );
-
- } break;
-
-
- case TRESP_CALL_SPLIT: {
- struct tresp_call_split *resp = (struct tresp_call_split*)data;
-
- dbg("receive TRESP_CALL_SPLIT (err[%d] id[%d])", resp->err, resp->id);
-
- telephony_call_complete_split(dbus_info->interface_object, dbus_info->invocation, resp->err, resp->id );
-
- } break;
-
- case TRESP_CALL_DEFLECT: {
- struct tresp_call_deflect *resp = (struct tresp_call_deflect*)data;
-
- dbg("receive TRESP_CALL_DEFLECT (err[%d] id[%d])", resp->err, resp->id);
-
- telephony_call_complete_deflect(dbus_info->interface_object, dbus_info->invocation, resp->err );
-
- } break;
-
- case TRESP_CALL_TRANSFER: {
- struct tresp_call_transfer *resp = (struct tresp_call_transfer*)data;
-
- dbg("receive TRESP_CALL_TRANSFER (err[%d] id[%d])", resp->err, resp->id);
-
- telephony_call_complete_transfer(dbus_info->interface_object, dbus_info->invocation, resp->err, resp->id );
-
- } break;
-
- case TRESP_CALL_START_CONT_DTMF: {
- struct tresp_call_dtmf *resp = (struct tresp_call_dtmf*)data;
-
- dbg("receive TRESP_CALL_START_CONT_DTMF (err[%d])", resp->err);
-
- telephony_call_complete_start_cont_dtmf(dbus_info->interface_object, dbus_info->invocation, resp->err);
- } break;
-
- case TRESP_CALL_STOP_CONT_DTMF: {
- struct tresp_call_dtmf *resp = (struct tresp_call_dtmf*)data;
-
- dbg("receive TRESP_CALL_STOP_CONT_DTMF (err[%d])", resp->err);
-
- telephony_call_complete_stop_cont_dtmf(dbus_info->interface_object, dbus_info->invocation, resp->err);
- } break;
-
- case TRESP_CALL_SEND_BURST_DTMF: {
- struct tresp_call_dtmf *resp = (struct tresp_call_dtmf*)data;
-
- dbg("receive TRESP_CALL_SEND_BURST_DTMF (err[%d])", resp->err);
-
- telephony_call_complete_send_burst_dtmf(dbus_info->interface_object, dbus_info->invocation, resp->err);
- } break;
-
- case TRESP_CALL_GET_PRIVACY_MODE: {
- struct tresp_call_get_voice_privacy_mode *resp = (struct tresp_call_get_voice_privacy_mode*)data;
-
- dbg("receive TRESP_CALL_GET_PRIVACY_MODE (err[%d])", resp->err);
- dbg("Voice call privacy mode %d",resp->privacy_mode);
-
- telephony_call_complete_get_privacy_mode(dbus_info->interface_object, dbus_info->invocation, resp->err, resp->privacy_mode);
- } break;
-
- case TRESP_CALL_SET_PRIVACY_MODE: {
- struct tresp_call_set_voice_privacy_mode *resp = (struct tresp_call_set_voice_privacy_mode *)data;
-
- dbg("receive TRESP_CALL_SET_PRIVACY_MODE (err[%d])", resp->err);
-
- telephony_call_complete_set_privacy_mode(dbus_info->interface_object, dbus_info->invocation, resp->err);
- } break;
-
- case TRESP_CALL_SET_SOUND_PATH: {
- struct tresp_call_set_sound_path *resp = (struct tresp_call_set_sound_path*)data;
-
- dbg("receive TRESP_CALL_SET_SOUND_PATH (err[%d])", resp->err);
-
- telephony_call_complete_set_sound_path(dbus_info->interface_object, dbus_info->invocation, resp->err);
- } break;
-
- case TRESP_CALL_SET_SOUND_VOLUME_LEVEL: {
- struct tresp_call_set_sound_volume_level *resp = (struct tresp_call_set_sound_volume_level*)data;
-
- dbg("receive TRESP_CALL_SET_SOUND_VOLUME_LEVEL (err[%d])", resp->err);
-
- telephony_call_complete_set_sound_volume_level(dbus_info->interface_object, dbus_info->invocation, resp->err);
- } break;
-
- case TRESP_CALL_GET_SOUND_VOLUME_LEVEL: {
- struct tresp_call_get_sound_volume_level *resp = (struct tresp_call_get_sound_volume_level*)data;
- GVariant *result = 0;
- GVariantBuilder b;
-
- dbg("receive TRESP_CALL_GET_SOUND_VOLUME_LEVEL (err[%d])", resp->err);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
-
- g_variant_builder_add(&b, "{sv}", "err", g_variant_new_int32(resp->err));
-
- if ( !resp->err ) {
-
- dbg("resp->record_num : [%d]", resp->record_num);
-
- for ( i=0; i<resp->record_num; i++ ) {
- dbg("sound_type : [%d], level:[%d]", resp->record[i].sound, resp->record[i].volume);
- g_variant_builder_add(&b, "{sv}", "type", g_variant_new_int32(resp->record[i].sound));
- g_variant_builder_add(&b, "{sv}", "level", g_variant_new_int32(resp->record[i].volume));
- }
-
- }
-
- g_variant_builder_close(&b);
-
- result = g_variant_builder_end(&b);
-
- telephony_call_complete_get_sound_volume_level(dbus_info->interface_object, dbus_info->invocation, result, resp->err );
-
- } break;
-
- case TRESP_CALL_SET_SOUND_MUTE_STATUS: {
- struct tresp_call_set_sound_mute_status *resp = (struct tresp_call_set_sound_mute_status*)data;
-
- dbg("receive TRESP_CALL_SET_SOUND_MUTE_STATUS (err[%d]", resp->err);
- telephony_call_complete_set_sound_mute_status(dbus_info->interface_object, dbus_info->invocation, resp->err);
- } break;
-
- case TRESP_CALL_GET_SOUND_MUTE_STATUS: {
- struct tresp_call_get_sound_mute_status *resp = (struct tresp_call_get_sound_mute_status*)data;
-
- dbg("receive TRESP_CALL_GET_SOUND_MUTE_STATUS (err[%d] path[%d] status[%d])",
- resp->err, resp->path, resp->status);
- telephony_call_complete_get_sound_mute_status(dbus_info->interface_object, dbus_info->invocation, resp->err, resp->path, resp->status );
-
- } break;
-
- case TRESP_CALL_SET_SOUND_RECORDING: {
- struct tresp_call_set_sound_recording *resp = (struct tresp_call_set_sound_recording*)data;
- telephony_call_complete_set_sound_recording(dbus_info->interface_object, dbus_info->invocation, resp->err );
-
- } break;
-
- case TRESP_CALL_SET_SOUND_EQUALIZATION: {
- struct tresp_call_set_sound_equalization *resp = (struct tresp_call_set_sound_equalization*)data;
- telephony_call_complete_set_sound_equalization(dbus_info->interface_object, dbus_info->invocation, resp->err );
-
- } break;
-
- case TRESP_CALL_SET_SOUND_NOISE_REDUCTION: {
- struct tresp_call_set_sound_noise_reduction *resp = (struct tresp_call_set_sound_noise_reduction*)data;
- telephony_call_complete_set_sound_noise_reduction(dbus_info->interface_object, dbus_info->invocation, resp->err );
-
- } break;
-
- case TRESP_CALL_SET_SOUND_CLOCK_STATUS: {
- struct tresp_call_set_sound_clock_status *resp = (struct tresp_call_set_sound_clock_status*)data;
- telephony_call_complete_set_sound_clock_status(dbus_info->interface_object, dbus_info->invocation, resp->err );
-
- } break;
-
- case TRESP_CALL_SET_PREFERRED_VOICE_SUBSCRIPTION: {
- struct tresp_call_set_preferred_voice_subscription *resp = (struct tresp_call_set_preferred_voice_subscription*)data;
- telephony_call_complete_set_preferred_voice_subscription(dbus_info->interface_object, dbus_info->invocation, resp->err );
- } break;
-
- case TRESP_CALL_GET_PREFERRED_VOICE_SUBSCRIPTION: {
- struct tresp_call_get_preferred_voice_subscription *resp = (struct tresp_call_get_preferred_voice_subscription*)data;
- telephony_call_complete_get_preferred_voice_subscription(dbus_info->interface_object, dbus_info->invocation,
- resp->preferred_subs, resp->err );
- } break;
-
- default:
- dbg("not handled command[%d]", command);
- break;
-
- }
-
- return TRUE;
-}
-
-gboolean dbus_plugin_call_notification(struct custom_data *ctx, CoreObject *source, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data)
-{
- TelephonyCall *call;
- char *cp_name;
-
- if (!object) {
- dbg("object is 0");
- return FALSE;
- }
- cp_name = (char *)tcore_server_get_cp_name_by_plugin(tcore_object_ref_plugin(source));
- dbg("Notification!!! Command: [0x%x] CP Name: [%s]",
- command, cp_name);
-
- call = telephony_object_peek_call(TELEPHONY_OBJECT(object));
-
- switch (command) {
- case TNOTI_CALL_STATUS_IDLE: {
- struct tnoti_call_status_idle *idle = (struct tnoti_call_status_idle*)data;
-
- if ( idle->type != CALL_TYPE_VIDEO ) {
- dbg("[ check ] call status : idle (voice call)");
- telephony_call_emit_voice_call_status_idle( call, idle->id, idle->cause, 0, 0 );
- } else {
- dbg("[ check ] call status : idle (video call)");
- telephony_call_emit_video_call_status_idle( call, idle->id, idle->cause, 0, 0 );
- }
-
- } break;
- case TNOTI_CALL_STATUS_DIALING: {
- struct tnoti_call_status_dialing *dialing = (struct tnoti_call_status_dialing*)data;
-
- if ( dialing->type != CALL_TYPE_VIDEO ) {
- dbg("[ check ] call status : dialing (type[%d] id[%d]) (voice call)", dialing->type, dialing->id);
- telephony_call_emit_voice_call_status_dialing( call, dialing->id );
- } else {
- dbg("[ check ] call status : dialing (type[%d] id[%d]) (video call)", dialing->type, dialing->id);
- telephony_call_emit_video_call_status_dialing( call, dialing->id );
- }
-
- } break;
- case TNOTI_CALL_STATUS_ALERT: {
- struct tnoti_call_status_alert *alert = (struct tnoti_call_status_alert*)data;
-
- if ( alert->type != CALL_TYPE_VIDEO ) {
- dbg("[ check ] call status : alert (voice call)");
- telephony_call_emit_voice_call_status_alert( call, alert->id );
- } else {
- dbg("[ check ] call status : alert (video call)");
- telephony_call_emit_video_call_status_alert( call, alert->id );
- }
-
- } break;
- case TNOTI_CALL_STATUS_ACTIVE: {
- struct tnoti_call_status_active *active = (struct tnoti_call_status_active*)data;
-
- if ( active->type != CALL_TYPE_VIDEO ) {
- dbg("[ check ] call status : active (voice call)");
- telephony_call_emit_voice_call_status_active( call, active->id );
- } else {
- dbg("[ check ] call status : active (video call)");
- telephony_call_emit_video_call_status_active( call, active->id );
- }
-
- } break;
- case TNOTI_CALL_STATUS_HELD: {
- struct tnoti_call_status_held *held = (struct tnoti_call_status_held*)data;
-
- dbg("[ check ] call status : held");
- telephony_call_emit_voice_call_status_held( call, held->id );
-
- } break;
- case TNOTI_CALL_STATUS_INCOMING: {
- struct tnoti_call_status_incoming *incoming = (struct tnoti_call_status_incoming*)data;
- enum dbus_tapi_sim_slot_id slot_id;
-
- dbg("[ check ] call status : incoming");
- slot_id = get_sim_slot_id_by_cp_name(cp_name);
-
- if ( incoming->type != CALL_TYPE_VIDEO ) {
- dbg("[ check ] call status : incoming (voice call)");
- telephony_call_emit_voice_call_status_incoming( call, incoming->id );
-
- _launch_voice_call( incoming, slot_id);
-
- } else {
- dbg("[ check ] call status : incoming (video call)");
- telephony_call_emit_video_call_status_incoming( call, incoming->id );
-
- _launch_video_call( incoming, slot_id);
- }
- } break;
-
- case TNOTI_CALL_INFO_WAITING: {
- int *id = (int*)data;
-
- dbg("[ check ] TNOTI_CALL_INFO_WAITING : (%d)", *id);
- telephony_call_emit_waiting( call, (gint)*id );
-
- } break;
-
- case TNOTI_CALL_INFO_FORWARDED: {
- int *id = (int*)data;
-
- dbg("[ check ] TNOTI_CALL_INFO_FORWARDED : (%d)", *id);
- telephony_call_emit_forwarded( call, (gint)*id );
-
- } break;
-
- case TNOTI_CALL_INFO_FORWARDED_CALL: {
- int *id = (int*)data;
-
- dbg("[ check ] TNOTI_CALL_INFO_FORWARDED_CALL : (%d)", *id);
- telephony_call_emit_forwarded_call( call, (gint)*id );
-
- } break;
-
- case TNOTI_CALL_INFO_BARRED_INCOMING: {
- int *id = (int*)data;
-
- dbg("[ check ] TNOTI_CALL_INFO_BARRED_INCOMING : (%d)", *id);
- telephony_call_emit_barred_incoming( call, (gint)*id );
-
- } break;
-
- case TNOTI_CALL_INFO_BARRED_OUTGOING: {
- int *id = (int*)data;
-
- dbg("[ check ] TNOTI_CALL_INFO_BARRED_OUTGOING : (%d)", *id);
- telephony_call_emit_barred_outgoing( call, (gint)*id );
-
- } break;
-
- case TNOTI_CALL_INFO_FORWARD_CONDITIONAL: {
- int *id = (int*)data;
-
- dbg("[ check ] TNOTI_CALL_INFO_FORWARD_CONDITIONAL : (%d)", *id);
- telephony_call_emit_forward_conditional( call, (gint)*id );
-
- } break;
-
- case TNOTI_CALL_INFO_FORWARD_UNCONDITIONAL: {
- int *id = (int*)data;
-
- dbg("[ check ] TNOTI_CALL_INFO_FORWARD_UNCONDITIONAL : (%d)", *id);
- telephony_call_emit_forward_unconditional( call, (gint)*id );
-
- } break;
-
- case TNOTI_CALL_INFO_HELD: {
- int *id = (int*)data;
-
- dbg("[ check ] TNOTI_CALL_INFO_HELD : (%d)", *id);
- telephony_call_emit_call_held( call, (gint)*id );
-
- } break;
-
- case TNOTI_CALL_INFO_ACTIVE: {
- int *id = (int*)data;
-
- dbg("[ check ] TNOTI_CALL_INFO_ACTIVE : (%d)", *id);
- telephony_call_emit_call_active( call, (gint)*id );
-
- } break;
-
- case TNOTI_CALL_INFO_JOINED: {
- int *id = (int*)data;
-
- dbg("[ check ] TNOTI_CALL_INFO_JOINED : (%d)", *id);
- telephony_call_emit_call_joined( call, (gint)*id );
-
- } break;
-
- case TNOTI_CALL_INFO_PRIVACY_MODE: {
- struct tnoti_call_info_voice_privacy_mode *privacy_info = (struct tnoti_call_info_voice_privacy_mode*)data;
-
- dbg("[ check ] TNOTI_CALL_INFO_PRIVACY_MODE : privacy mode ", privacy_info->privacy_mode);
- telephony_call_emit_call_privacy_mode( call, privacy_info->privacy_mode );
-
- } break;
-
- case TNOTI_CALL_OTASP_STATUS: {
- struct tnoti_call_otasp_status *otasp = (struct tnoti_call_otasp_status *)data;
-
- dbg("[ check ] TNOTI_CALL_OTASP_STATUS : (%d)", otasp->otasp_status);
- telephony_call_emit_call_otasp_status( call, otasp->otasp_status );
-
- } break;
-
- case TNOTI_CALL_OTAPA_STATUS: {
- struct tnoti_call_otapa_status *otapa = (struct tnoti_call_otapa_status *)data;
-
- dbg("[ check ] TNOTI_CALL_OTAPA_STATUS : (%d)", otapa->otapa_status);
- telephony_call_emit_call_otapa_status( call, otapa->otapa_status );
-
- } break;
-
- case TNOTI_CALL_SIGNAL_INFO: {
-
- struct tnoti_call_signal_info *sig_info = (struct tnoti_call_signal_info *)data;
- unsigned int signal;
- if (sig_info->signal_type == CALL_SIGNAL_TYPE_TONE) {
- signal = sig_info->signal.sig_tone_type;
- } else if(sig_info->signal_type == CALL_SIGNAL_TYPE_ISDN_ALERTING) {
- signal = sig_info->signal.sig_isdn_alert_type;
- } else if(sig_info->signal_type == CALL_SIGNAL_TYPE_IS54B_ALERTING) {
- signal = sig_info->signal.sig_is54b_alert_type;
- } else {
- err("Unknown Signal type");
- return FALSE;
- }
- dbg("[ check ] TNOTI_CALL_SIGNAL_INFO : Signal type (%d), Pitch type (%d), Signal %d", sig_info->signal_type, sig_info->pitch_type, signal);
- telephony_call_emit_call_signal_info( call, sig_info->signal_type, sig_info->pitch_type, signal);
-
- } break;
-
- case TNOTI_CALL_INFO_REC: {
- struct tnoti_call_info_rec *noti = (struct tnoti_call_info_rec *)data;
- gchar *param = NULL;
- if (noti->rec_info.type == CALL_REC_NAME_INFO) {
- param = g_strdup(noti->rec_info.data.name);
- } else if (noti->rec_info.type == CALL_REC_NUMBER_INFO) {
- param = g_strdup(noti->rec_info.data.number);
- } else {
- err("Unknown rec info type (%d)", noti->rec_info.type);
- return FALSE;
- }
- dbg("[ check ] TNOTI_CALL_INFO_REC : id:(%d) type:(%d), param:(%s)",
- noti->rec_info.id, noti->rec_info.type, param);
- telephony_call_emit_call_info_rec( call, noti->rec_info.id, noti->rec_info.type, param);
- g_free(param);
- } break;
-
- case TNOTI_CALL_SOUND_PATH: {
- struct tnoti_call_sound_path *noti = (struct tnoti_call_sound_path*)data;
- telephony_call_emit_call_sound_path( call, noti->path );
-
-
- } break;
-
- case TNOTI_CALL_SOUND_RINGBACK_TONE: {
- struct tnoti_call_sound_ringback_tone *noti = (struct tnoti_call_sound_ringback_tone*)data;
- telephony_call_emit_call_sound_ringback_tone( call, (gint)noti->status );
-
- } break;
-
- case TNOTI_CALL_SOUND_WBAMR: {
- struct tnoti_call_sound_wbamr *noti = (struct tnoti_call_sound_wbamr*)data;
- telephony_call_emit_call_sound_wbamr( call, (gint)noti->status );
-
- } break;
-
- case TNOTI_CALL_SOUND_EQUALIZATION: {
- struct tnoti_call_sound_equalization *noti = (struct tnoti_call_sound_equalization*)data;
- telephony_call_emit_call_sound_equalization( call, (gint)noti->mode, (gint)noti->direction );
-
- } break;
-
- case TNOTI_CALL_SOUND_NOISE_REDUCTION: {
- struct tnoti_call_sound_noise_reduction *noti = (struct tnoti_call_sound_noise_reduction*)data;
- telephony_call_emit_call_sound_noise_reduction( call, (gint)noti->status );
-
- } break;
-
- case TNOTI_CALL_SOUND_CLOCK_STATUS: {
- struct tnoti_call_sound_clock_status *noti = (struct tnoti_call_sound_clock_status*)data;
- telephony_call_emit_call_sound_clock_status( call, noti->status );
-
- } break;
-
- case TNOTI_CALL_PREFERRED_VOICE_SUBSCRIPTION: {
- struct tnoti_call_preferred_voice_subscription *noti = (struct tnoti_call_preferred_voice_subscription*)data;
- telephony_call_emit_call_preferred_voice_subscription( call, noti->preferred_subs );
-
- } break;
-
- default:
- dbg("not handled command[%d]", command);
- break;
- }
-
- return TRUE;
-}
-
--- /dev/null
+/*
+ * tel-plugin-dbus-tapi
+ *
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Ja-young Gu <jygu@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdio.h>
+
+#include <glib.h>
+
+#include <tcore.h>
+#include <plugin.h>
+
+#include "dtapi_common.h"
+
+#ifndef PLUGIN_VERSION
+#define PLUGIN_VERSION 1
+#endif
+
+static gboolean on_load()
+{
+ dbg("i'm load!");
+
+ return TRUE;
+}
+
+static gboolean on_init(TcorePlugin *p)
+{
+ gboolean ret;
+
+ dbg("i'm init!");
+
+ if (!p)
+ return FALSE;
+
+ ret = dtapi_init(p);
+ dbg("DTAPI initialization: [%s]", (ret == TRUE ? "Successful" : "Fail"));
+
+ return ret;
+}
+
+static void on_unload(TcorePlugin *p)
+{
+ dbg("i'm unload");
+
+ if (!p)
+ return;
+
+ dtapi_deinit(p);
+}
+
+/* DBUS Communicator descriptor */
+EXPORT_API struct tcore_plugin_define_desc plugin_define_desc = {
+ .name = "NEW_DBUS_COMMUNICATOR",
+ .priority = TCORE_PLUGIN_PRIORITY_HIGH,
+ .version = PLUGIN_VERSION,
+ .load = on_load,
+ .init = on_init,
+ .unload = on_unload
+};
--- /dev/null
+/*
+ * tel-plugin-dbus-tapi
+ *
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Ja-young Gu <jygu@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <glib.h>
+
+#include <tcore.h>
+#include <plugin.h>
+#include <server.h>
+#include <co_call.h>
+
+#include "generated-code.h"
+#include "dtapi_common.h"
+
+static gboolean on_call_dial(TelephonyCall *call,
+ GDBusMethodInvocation *invocation,
+ gint call_type, gint call_ecc, gchar *call_number,
+ gpointer user_data)
+{
+ struct treq_call_dial req;
+ struct custom_data *ctx = user_data;
+
+ memset(&req, 0x0, sizeof(req));
+
+ if (!check_access_control(invocation, AC_CALL, "x"))
+ return TRUE;
+
+ req.type = call_type;
+ req.ecc = call_ecc;
+
+ if (call_number)
+ g_strlcpy(req.number, call_number, MAX_CALL_DIAL_NUM_LEN);
+
+ dbg("[%s] Dial number len: [%d] Dial number: [%s]",
+ GET_CP_NAME(invocation), strlen(req.number), req.number);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, call, invocation,
+ TREQ_CALL_DIAL,
+ &req, sizeof(struct treq_call_dial));
+
+ return TRUE;
+}
+
+static gboolean on_call_answer(TelephonyCall *call,
+ GDBusMethodInvocation *invocation,
+ gint call_handle, gint answer_type, gpointer user_data)
+{
+ struct treq_call_answer req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_CALL, "x"))
+ return TRUE;
+
+ req.handle = call_handle;
+ req.type = answer_type;
+
+ dbg("[%s] Call handle: [%d] Answer type: [%s]",
+ GET_CP_NAME(invocation), req.handle,
+ (req.type == CALL_ANSWER_TYPE_ACCEPT ? "ACCEPT" :
+ (req.type == CALL_ANSWER_TYPE_REJECT ? "REJECT" :
+ (req.type == CALL_ANSWER_TYPE_REPLACE ? "REPLACE" :
+ (req.type == CALL_ANSWER_TYPE_HOLD_ACCEPT ? "HOLD & ACCEPT" :
+ "UNKNOWN OPERATION")))));
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, call, invocation,
+ TREQ_CALL_ANSWER,
+ &req, sizeof(struct treq_call_answer));
+
+ return TRUE;
+}
+
+static gboolean on_call_end(TelephonyCall *call,
+ GDBusMethodInvocation *invocation,
+ gint call_handle, gint end_type, gpointer user_data)
+{
+ struct treq_call_end req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_CALL, "x"))
+ return TRUE;
+
+ req.handle = call_handle;
+ req.type = end_type;
+
+ dbg("[%s] Call handle: [%d] End type: [%s]",
+ GET_CP_NAME(invocation), req.handle,
+ (req.type == CALL_END_TYPE_ALL ? "END ALL" :
+ (req.type == CALL_END_TYPE_ACTIVE_ALL ? "END ALL ACTIVE" :
+ (req.type == CALL_END_TYPE_HOLD_ALL ? "END ALL HELD" :
+ (req.type == CALL_END_TYPE_DEFAULT ? "END SPECIFIC" :
+ "UNKNOWN OPERATION")))));
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, call, invocation,
+ TREQ_CALL_END, &req, sizeof(struct treq_call_end));
+
+ return TRUE;
+}
+
+static gboolean on_call_start_cont_dtmf(TelephonyCall *call,
+ GDBusMethodInvocation *invocation,
+ guchar dtmf_digit, gpointer user_data)
+{
+ struct treq_call_start_cont_dtmf req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_CALL, "x"))
+ return TRUE;
+
+ memset(&req, 0x0, sizeof(req));
+
+ req.dtmf_digit = dtmf_digit;
+
+ dbg("[%s] DTMF Digit: [%c]", GET_CP_NAME(invocation), req.dtmf_digit);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, call, invocation,
+ TREQ_CALL_START_CONT_DTMF,
+ &req, sizeof(struct treq_call_start_cont_dtmf));
+
+ return TRUE;
+}
+
+static gboolean on_call_stop_cont_dtmf(TelephonyCall *call,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_CALL, "x"))
+ return TRUE;
+
+ dbg("[%s] Stop DTMF", GET_CP_NAME(invocation));
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, call, invocation,
+ TREQ_CALL_STOP_CONT_DTMF,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_call_send_burst_dtmf(TelephonyCall *call,
+ GDBusMethodInvocation *invocation,
+ gchar *dtmf_string, gint pulse_width, gint inter_digit_interval, gpointer user_data)
+{
+ struct treq_call_send_burst_dtmf req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_CALL, "x"))
+ return TRUE;
+
+ memset(&req, 0x0, sizeof(req));
+
+ if (dtmf_string) {
+ g_strlcpy(req.dtmf_string, dtmf_string, MAX_CALL_BURST_DTMF_STRING_LEN + 1);
+ } else {
+ err("Invalid DTMF string");
+
+ FAIL_RESPONSE(invocation, "Invalid Input");
+
+ return TRUE;
+ }
+
+ req.pulse_width = pulse_width;
+ req.inter_digit_interval = inter_digit_interval;
+
+ dbg("[%s] Pulse width: [%d] Inter-digit interval: [%d]",
+ GET_CP_NAME(invocation),
+ req.pulse_width, req.inter_digit_interval);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, call, invocation,
+ TREQ_CALL_SEND_BURST_DTMF,
+ &req, sizeof(struct treq_call_send_burst_dtmf));
+
+ return TRUE;
+}
+
+static gboolean on_call_active(TelephonyCall *call,
+ GDBusMethodInvocation *invocation,
+ gint call_handle, gpointer user_data)
+{
+ struct treq_call_active req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_CALL, "x"))
+ return TRUE;
+
+ req.handle = call_handle;
+
+ dbg("[%s] Call handle: [%d]", GET_CP_NAME(invocation), req.handle);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, call, invocation,
+ TREQ_CALL_ACTIVE,
+ &req, sizeof(struct treq_call_active));
+
+ return TRUE;
+}
+
+static gboolean on_call_hold(TelephonyCall *call,
+ GDBusMethodInvocation *invocation,
+ gint call_handle, gpointer user_data)
+{
+ struct treq_call_hold req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_CALL, "x"))
+ return TRUE;
+
+ req.handle = call_handle;
+
+ dbg("[%s] Call handle: [%d]", GET_CP_NAME(invocation), req.handle);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, call, invocation,
+ TREQ_CALL_HOLD,
+ &req, sizeof(struct treq_call_hold));
+
+ return TRUE;
+}
+
+static gboolean on_call_swap(TelephonyCall *call,
+ GDBusMethodInvocation *invocation,
+ gint call_handle, gpointer user_data)
+{
+ struct treq_call_swap req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_CALL, "x"))
+ return TRUE;
+
+ req.handle = call_handle;
+
+ dbg("[%s] Call handle: [%d]", GET_CP_NAME(invocation), req.handle);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, call, invocation,
+ TREQ_CALL_SWAP,
+ &req, sizeof(struct treq_call_swap));
+
+ return TRUE;
+}
+
+static gboolean on_call_join(TelephonyCall *call,
+ GDBusMethodInvocation *invocation,
+ gint call_handle, gpointer user_data)
+{
+ struct treq_call_join req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_CALL, "x"))
+ return TRUE;
+
+ req.handle = call_handle;
+
+ dbg("[%s] Call handle: [%d]", GET_CP_NAME(invocation), req.handle);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, call, invocation,
+ TREQ_CALL_JOIN,
+ &req, sizeof(struct treq_call_join));
+
+ return TRUE;
+}
+
+static gboolean on_call_split(TelephonyCall *call,
+ GDBusMethodInvocation *invocation,
+ gint call_handle, gpointer user_data)
+{
+ struct treq_call_split req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_CALL, "x"))
+ return TRUE;
+
+ req.handle = call_handle;
+
+ dbg("[%s] Call handle: [%d]", GET_CP_NAME(invocation), req.handle);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, call, invocation,
+ TREQ_CALL_SPLIT,
+ &req, sizeof(struct treq_call_split));
+
+ return TRUE;
+}
+
+static gboolean on_call_transfer(TelephonyCall *call,
+ GDBusMethodInvocation *invocation,
+ gint call_handle, gpointer user_data)
+{
+ struct treq_call_transfer req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_CALL, "x"))
+ return TRUE;
+
+ req.handle = call_handle;
+
+ dbg("[%s] Call handle: [%d]", GET_CP_NAME(invocation), req.handle);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, call, invocation,
+ TREQ_CALL_TRANSFER,
+ &req, sizeof(struct treq_call_transfer));
+
+ return TRUE;
+}
+
+static gboolean on_call_deflect(TelephonyCall *call,
+ GDBusMethodInvocation *invocation,
+ gchar *call_number, gpointer user_data)
+{
+ struct treq_call_deflect req = {0};
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_CALL, "x"))
+ return TRUE;
+
+ if (call_number)
+ g_strlcpy(req.number, call_number, MAX_CALL_DIAL_NUM_LEN);
+
+ dbg("[%s] Call handle: [%d] Number: [%s]", GET_CP_NAME(invocation),
+ req.handle, req.number);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, call, invocation,
+ TREQ_CALL_DEFLECT,
+ &req, sizeof(struct treq_call_deflect));
+
+ return TRUE;
+}
+
+static gboolean on_call_get_privacy_mode(TelephonyCall *call,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_CALL, "r"))
+ return TRUE;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, call, invocation,
+ TREQ_CALL_GET_PRIVACY_MODE,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_call_set_privacy_mode(TelephonyCall *call,
+ GDBusMethodInvocation *invocation,
+ gint privacy_mode, gpointer user_data)
+{
+ struct treq_call_set_voice_privacy_mode req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_CALL, "w"))
+ return TRUE;
+
+ req.privacy_mode = privacy_mode;
+
+ dbg("[%s] Privacy mode: [%d]", GET_CP_NAME(invocation), req.privacy_mode);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, call, invocation,
+ TREQ_CALL_SET_PRIVACY_MODE,
+ &req, sizeof(struct treq_call_set_voice_privacy_mode));
+
+ return TRUE;
+}
+
+static gboolean on_call_get_status(TelephonyCall *call,
+ GDBusMethodInvocation *invocation,
+ gint call_handle, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ TcorePlugin *plugin = 0;
+ CoreObject *call_co = NULL;
+ CallObject *call_obj = NULL;
+
+ gchar call_number[MAX_CALL_NUMBER_LEN];
+ gint call_type;
+ gboolean call_direction;
+ gint call_status;
+ gboolean call_multiparty_state;
+ gboolean is_volte_call;
+
+ if (!check_access_control(invocation, AC_CALL, "r"))
+ return TRUE;
+
+ plugin = tcore_server_find_plugin(ctx->server, GET_CP_NAME(invocation));
+ call_co = tcore_plugin_ref_core_object(plugin, CORE_OBJECT_TYPE_CALL);
+ call_obj = tcore_call_object_find_by_handle(call_co, call_handle);
+ if (!call_obj) {
+ err("Call object: NULL");
+
+ FAIL_RESPONSE(invocation, DEFAULT_MSG_REQ_FAILED);
+
+ return TRUE;
+ }
+
+ dbg("[%s] Call handle: [%d]", GET_CP_NAME(invocation), call_handle);
+
+ memset(call_number, 0x0, MAX_CALL_NUMBER_LEN);
+ tcore_call_object_get_number(call_obj, call_number);
+ call_type = tcore_call_object_get_type(call_obj);
+ call_direction = tcore_call_object_get_direction(call_obj);
+
+ if (call_direction == TCORE_CALL_DIRECTION_OUTGOING)
+ call_direction = TRUE;
+ else
+ call_direction = FALSE;
+
+ call_status = tcore_call_object_get_status(call_obj);
+ call_multiparty_state = tcore_call_object_get_multiparty_state(call_obj);
+ is_volte_call = tcore_call_object_get_is_volte_call(call_obj);
+
+ telephony_call_complete_get_status(call, invocation,
+ call_handle, call_number, call_type,
+ call_direction, call_status, call_multiparty_state, is_volte_call);
+
+ return TRUE;
+}
+
+static gboolean on_call_get_status_all(TelephonyCall *call,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ TcorePlugin *plugin = 0;
+ CoreObject *call_co = NULL;
+ CallObject *call_obj = NULL;
+ GSList *list, *tmp;
+
+ GVariant *gv = NULL;
+ GVariantBuilder b;
+
+ gint call_id;
+ gint handle;
+ gchar call_number[MAX_CALL_NUMBER_LEN];
+ gint call_type;
+ gboolean call_direction;
+ gint call_status;
+ gboolean call_multiparty_state;
+
+ int len, i;
+
+ if (!check_access_control(invocation, AC_CALL, "r"))
+ return TRUE;
+
+ plugin = tcore_server_find_plugin(ctx->server, GET_CP_NAME(invocation));
+ call_co = tcore_plugin_ref_core_object(plugin, CORE_OBJECT_TYPE_CALL);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+ for (i = 0; i < TCORE_CALL_STATUS_MAX; i++) {
+ tmp = list = tcore_call_object_find_by_status(call_co, i);
+ if (list == NULL)
+ continue;
+
+ while (tmp) {
+ call_obj = (CallObject *)tmp->data;
+ if (!call_obj) {
+ err("call object: NULL");
+
+ /* Next Call object */
+ tmp = g_slist_next(tmp);
+ continue;
+ }
+
+ handle = tcore_call_object_get_handle(call_obj);
+ call_id = tcore_call_object_get_id(call_obj);
+
+ memset(call_number, 0, MAX_CALL_NUMBER_LEN);
+ len = tcore_call_object_get_number(call_obj, call_number);
+ if (!len)
+ warn("[ CHECK ] NO number: Call handle: [%d]", handle);
+
+ call_type = tcore_call_object_get_type(call_obj);
+ call_direction = tcore_call_object_get_direction(call_obj);
+
+ if (call_direction == TCORE_CALL_DIRECTION_OUTGOING)
+ call_direction = TRUE;
+ else
+ call_direction = FALSE;
+
+ call_status = tcore_call_object_get_status(call_obj);
+ if ((TCORE_CALL_STATUS_SETUP == call_status)
+ || (TCORE_CALL_STATUS_SETUP_PENDING == call_status)) {
+ dbg("SETUP/SETUP_PENDING found. This is already notified as " \
+ "dialing status to applicaiton, so change it to 'Dialing' ");
+ call_status = TCORE_CALL_STATUS_DIALING;
+ }
+
+ call_multiparty_state = tcore_call_object_get_multiparty_state(call_obj);
+
+ dbg("Call handle: [%d] Call ID: [%d] Call number: [%s] Call number len: [%d]",
+ handle, call_id, call_number, len);
+ dbg("Call Type: [%s] Call Direction: [%s] Call Status: [%s] Multi-Party Call: [%s]",
+ call_type == TCORE_CALL_TYPE_VOICE ? "VOICE" :
+ (call_type == TCORE_CALL_TYPE_VIDEO ? "VIDEO" :
+ (call_type == TCORE_CALL_TYPE_E911 ? "E911" :
+ (call_type == TCORE_CALL_TYPE_STDOTASP ? "STDOTASP" :
+ (call_type == TCORE_CALL_TYPE_NONSTDOTASP ? "NONSTDOTASP" : "UNKNOWN")))),
+ (call_direction == TRUE ? "MO" : "MT"),
+ (call_status == TCORE_CALL_STATUS_IDLE ? "IDLE" :
+ (call_status == TCORE_CALL_STATUS_ACTIVE ? "ACTIVE" :
+ (call_status == TCORE_CALL_STATUS_HELD ? "HELD" :
+ (call_status == TCORE_CALL_STATUS_DIALING ? "DIALING" :
+ (call_status == TCORE_CALL_STATUS_ALERT ? "ALERT" :
+ (call_status == TCORE_CALL_STATUS_INCOMING ? "INCOMING" :
+ (call_status == TCORE_CALL_STATUS_WAITING ? "WAITING" :
+ (call_status == TCORE_CALL_STATUS_SETUP ? "SETUP" :
+ (call_status == TCORE_CALL_STATUS_SETUP_PENDING ? "SETUP_PENDING" : "UNKNOWN"))))))))),
+ (call_multiparty_state == 1 ? "YES" : "NO"));
+
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "call_id",
+ g_variant_new_int32(handle));
+ g_variant_builder_add(&b, "{sv}", "call_number",
+ g_variant_new_string(call_number));
+ g_variant_builder_add(&b, "{sv}", "call_type",
+ g_variant_new_int32(call_type));
+ g_variant_builder_add(&b, "{sv}", "call_direction",
+ g_variant_new_boolean(call_direction));
+ g_variant_builder_add(&b, "{sv}", "call_state",
+ g_variant_new_int32(call_status));
+ g_variant_builder_add(&b, "{sv}", "call_multiparty_state",
+ g_variant_new_boolean(call_multiparty_state));
+ g_variant_builder_close(&b);
+
+ /* Next Call object */
+ tmp = g_slist_next(tmp);
+ }
+
+ /* Free list */
+ g_slist_free(list);
+ }
+ gv = g_variant_builder_end(&b);
+
+ telephony_call_complete_get_status_all(call, invocation, gv);
+
+ return TRUE;
+}
+
+static gboolean on_call_set_sound_path(TelephonyCall *call,
+ GDBusMethodInvocation *invocation,
+ gint sound_path, gboolean extra_volume_on, gpointer user_data)
+{
+ struct treq_call_set_sound_path req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_CALL, "w"))
+ return TRUE;
+
+ req.path = sound_path;
+ req.extra_volume_on = extra_volume_on;
+
+ dbg("[%s] Sound path: [%d] Extra Volume: [%s]", GET_CP_NAME(invocation),
+ req.path, (extra_volume_on ? "ON" : "OFF"));
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, call, invocation,
+ TREQ_CALL_SET_SOUND_PATH,
+ &req, sizeof(struct treq_call_set_sound_path));
+
+ return TRUE;
+}
+
+static gboolean on_call_get_sound_volume_level(TelephonyCall *call,
+ GDBusMethodInvocation *invocation,
+ gint sound_device, gint sound_type, gpointer user_data)
+{
+ struct treq_call_get_sound_volume_level req;
+ struct custom_data *ctx = user_data;
+ TReturn ret;
+
+ if (!check_access_control(invocation, AC_CALL, "r"))
+ return TRUE;
+
+ req.device = sound_device;
+ req.sound = sound_type;
+
+ dbg("[%s] Sound device: [%d] Sound type: [%d]", GET_CP_NAME(invocation),
+ req.device, req.sound);
+
+ /* Dispatch request */
+ ret = dtapi_dispatch_request_ex(ctx, call, invocation,
+ TREQ_CALL_GET_SOUND_VOLUME_LEVEL,
+ &req, sizeof(struct treq_call_get_sound_volume_level));
+ if (ret != TCORE_RETURN_SUCCESS) {
+ GVariantBuilder b;
+ GVariant *result = 0;
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "err", g_variant_new_int32(ret));
+ g_variant_builder_close(&b);
+ result = g_variant_builder_end(&b);
+
+ telephony_call_complete_get_sound_volume_level(call,
+ invocation, result, ret);
+ }
+
+ return TRUE;
+}
+
+static gboolean on_call_set_sound_volume_level(TelephonyCall *call,
+ GDBusMethodInvocation *invocation,
+ gint sound_device, gint sound_type, gint sound_volume,
+ gpointer user_data)
+{
+ struct treq_call_set_sound_volume_level req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_CALL, "w"))
+ return TRUE;
+
+ req.device = sound_device;
+ req.sound = sound_type;
+ req.volume = sound_volume;
+
+ dbg("[%s] Sound device: [%d] Sound type: [%d] Volume level: [%d]",
+ GET_CP_NAME(invocation),
+ req.device, req.sound, req.volume);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, call, invocation,
+ TREQ_CALL_SET_SOUND_VOLUME_LEVEL,
+ &req, sizeof(struct treq_call_set_sound_volume_level));
+
+ return TRUE;
+}
+
+static gboolean on_call_get_sound_mute_status(TelephonyCall *call,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_CALL, "r"))
+ return TRUE;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, call, invocation,
+ TREQ_CALL_GET_SOUND_MUTE_STATUS,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_call_set_sound_mute_status(TelephonyCall *call,
+ GDBusMethodInvocation *invocation, gint status, gint path,
+ gpointer user_data)
+{
+ struct treq_call_set_sound_mute_status req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_CALL, "w"))
+ return TRUE;
+
+ req.path = path;
+ req.status = status;
+
+ dbg("[%s] Path: [%s] Mute Status: [%s]", GET_CP_NAME(invocation),
+ (req.path == CALL_SOUND_MUTE_PATH_TX ? "OUTGOING" :
+ (req.path == CALL_SOUND_MUTE_PATH_RX ? "INCOMING" :
+ "BOTH In- & Out-coming")),
+ (req.status == CALL_SOUND_MUTE_STATUS_OFF ? "OFF" : "ON"));
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, call, invocation,
+ TREQ_CALL_SET_SOUND_MUTE_STATUS,
+ &req, sizeof(struct treq_call_set_sound_mute_status));
+
+ return TRUE;
+}
+
+static gboolean on_call_set_sound_recording(TelephonyCall *call,
+ GDBusMethodInvocation *invocation,
+ gint recording_state, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ struct treq_call_set_sound_recording req;
+
+ if (!check_access_control(invocation, AC_CALL, "w"))
+ return TRUE;
+
+ req.state = (gboolean)recording_state;
+
+ dbg("[%s] Recording state: [%s]", GET_CP_NAME(invocation),
+ (req.state ? "ON" : "OFF"));
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, call, invocation,
+ TREQ_CALL_SET_SOUND_RECORDING,
+ &req, sizeof(struct treq_call_set_sound_recording));
+
+ return TRUE;
+}
+
+static gboolean on_call_set_sound_equalization(TelephonyCall *call,
+ GDBusMethodInvocation *invocation,
+ gint eq_mode, gint eq_direction, gchar *eq_parameter,
+ gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ struct treq_call_set_sound_equalization req;
+
+ if (!check_access_control(invocation, AC_CALL, "w"))
+ return TRUE;
+
+ req.mode = eq_mode;
+ req.direction = (enum telephony_call_sound_direction)eq_direction;
+ memcpy((char *)req.parameter, (const char *)eq_parameter, (MAX_CALL_EQ_PARAMETER_SIZE * 2));
+
+ dbg("[%s] Equalization mode: [%d] Direction: [%s]",
+ GET_CP_NAME(invocation), req.mode,
+ (req.direction == CALL_SOUND_DIRECTION_LEFT ? "LEFT" : "RIGHT"));
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, call, invocation,
+ TREQ_CALL_SET_SOUND_EQUALIZATION,
+ &req, sizeof(struct treq_call_set_sound_equalization));
+
+ return TRUE;
+}
+
+static gboolean on_call_set_sound_noise_reduction(TelephonyCall *call,
+ GDBusMethodInvocation *invocation,
+ gint nr_state, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ struct treq_call_set_sound_noise_reduction req;
+
+ if (!check_access_control(invocation, AC_CALL, "w"))
+ return TRUE;
+
+ req.status = (gboolean)nr_state;
+
+ dbg("[%s] NR Status: [%d]", GET_CP_NAME(invocation), req.status);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, call, invocation,
+ TREQ_CALL_SET_SOUND_NOISE_REDUCTION,
+ &req, sizeof(struct treq_call_set_sound_noise_reduction));
+
+ return TRUE;
+}
+
+static gboolean on_call_set_sound_clock_status(TelephonyCall *call,
+ GDBusMethodInvocation *invocation,
+ gboolean clock_status, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ struct treq_call_set_sound_clock_status req;
+
+ if (!check_access_control(invocation, AC_CALL, "w"))
+ return TRUE;
+
+ req.status = clock_status;
+
+ dbg("[%s] Clock Status: [%s]", GET_CP_NAME(invocation),
+ (req.status ? "ON" : "OFF"));
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, call, invocation,
+ TREQ_CALL_SET_SOUND_CLOCK_STATUS,
+ &req, sizeof(struct treq_call_set_sound_clock_status));
+
+ return TRUE;
+}
+
+static gboolean on_call_set_preferred_voice_subscription(TelephonyCall *call,
+ GDBusMethodInvocation *invocation,
+ gint preferred_subscription, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ struct treq_call_set_preferred_voice_subscription req;
+
+ if (!check_access_control(invocation, AC_CALL, "w"))
+ return TRUE;
+
+ req.preferred_subs = preferred_subscription;
+
+ dbg("[%s] Preferred Voice subscription: [%s]", GET_CP_NAME(invocation),
+ (req.preferred_subs == CALL_PREFERRED_VOICE_SUBS_CURRENT_NETWORK ? "CURRENT NW" :
+ (req.preferred_subs == CALL_PREFERRED_VOICE_SUBS_ASK_ALWAYS ? "ASK ALWAYS" :
+ (req.preferred_subs == CALL_PREFERRED_VOICE_SUBS_SIM1 ? "SIM 1" :
+ (req.preferred_subs == CALL_PREFERRED_VOICE_SUBS_SIM2 ? "SIM 2" :
+ "UNKNOWN")))));
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, call, invocation,
+ TREQ_CALL_SET_PREFERRED_VOICE_SUBSCRIPTION,
+ &req, sizeof(struct treq_call_set_preferred_voice_subscription));
+
+ return TRUE;
+}
+
+static gboolean on_call_get_preferred_voice_subscription(TelephonyCall *call,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_CALL, "r"))
+ return TRUE;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, call, invocation,
+ TREQ_CALL_GET_PREFERRED_VOICE_SUBSCRIPTION,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_call_modify(TelephonyCall *call,
+ GDBusMethodInvocation *invocation,
+ gint call_handle, gint call_type, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ struct treq_call_modify req = {0};
+
+ if (!check_access_control(invocation, AC_CALL, "x"))
+ return TRUE;
+
+ req.handle = call_handle;
+ req.call_type = call_type;
+
+ dbg("[%s] Call handle: [%d] Call type: [%s]",
+ GET_CP_NAME(invocation), req.handle,
+ (req.call_type == CALL_TYPE_VOICE ? "VOICE" :
+ (req.call_type == CALL_TYPE_VIDEO ? "VIDEO" :
+ "EMERGENCY")));
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, call, invocation,
+ TREQ_CALL_MODIFY,
+ &req, sizeof(struct treq_call_modify));
+
+ return TRUE;
+}
+
+static gboolean on_call_confirm_modify(TelephonyCall *call,
+ GDBusMethodInvocation *invocation,
+ gint call_handle, gint confirm_type, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ struct treq_call_confirm_modify req = {0};
+
+ if (!check_access_control(invocation, AC_CALL, "x"))
+ return TRUE;
+
+ req.handle = call_handle;
+ req.confirm_type = confirm_type;
+
+ dbg("[%s] Call handle: [%d] Confirm type: [%s]",
+ GET_CP_NAME(invocation), req.handle,
+ (req.confirm_type == CALL_CONFIRM_TYPE_ACCEPT ? "ACCEPT" :
+ "REJECT"));
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, call, invocation,
+ TREQ_CALL_CONFIRM_MODIFY,
+ &req, sizeof(struct treq_call_confirm_modify));
+
+ return TRUE;
+}
+
+gboolean dbus_plugin_setup_call_interface(TelephonyObjectSkeleton *object,
+ struct custom_data *ctx)
+{
+ TelephonyCall *call;
+
+ call = telephony_call_skeleton_new();
+ telephony_object_skeleton_set_call(object, call);
+ g_object_unref(call);
+
+ dbg("call = %p", call);
+
+ /*
+ * Register signal handlers for CALL interface
+ */
+ g_signal_connect(call,
+ "handle-dial",
+ G_CALLBACK(on_call_dial), ctx);
+
+ g_signal_connect(call,
+ "handle-answer",
+ G_CALLBACK(on_call_answer), ctx);
+
+ g_signal_connect(call,
+ "handle-end",
+ G_CALLBACK(on_call_end), ctx);
+
+ g_signal_connect(call,
+ "handle-start-cont-dtmf",
+ G_CALLBACK(on_call_start_cont_dtmf), ctx);
+
+ g_signal_connect(call,
+ "handle-stop-cont-dtmf",
+ G_CALLBACK(on_call_stop_cont_dtmf), ctx);
+
+ g_signal_connect(call,
+ "handle-send-burst-dtmf",
+ G_CALLBACK(on_call_send_burst_dtmf), ctx);
+
+ g_signal_connect(call,
+ "handle-active",
+ G_CALLBACK(on_call_active), ctx);
+
+ g_signal_connect(call,
+ "handle-hold",
+ G_CALLBACK(on_call_hold), ctx);
+
+ g_signal_connect(call,
+ "handle-swap",
+ G_CALLBACK(on_call_swap), ctx);
+
+ g_signal_connect(call,
+ "handle-join",
+ G_CALLBACK(on_call_join), ctx);
+
+ g_signal_connect(call,
+ "handle-split",
+ G_CALLBACK(on_call_split), ctx);
+
+ g_signal_connect(call,
+ "handle-transfer",
+ G_CALLBACK(on_call_transfer), ctx);
+
+ g_signal_connect(call,
+ "handle-deflect",
+ G_CALLBACK(on_call_deflect), ctx);
+
+ g_signal_connect(call,
+ "handle-get-privacy-mode",
+ G_CALLBACK(on_call_get_privacy_mode), ctx);
+
+ g_signal_connect(call,
+ "handle-set-privacy-mode",
+ G_CALLBACK(on_call_set_privacy_mode), ctx);
+
+ g_signal_connect(call,
+ "handle-get-status",
+ G_CALLBACK(on_call_get_status), ctx);
+
+ g_signal_connect(call,
+ "handle-get-status-all",
+ G_CALLBACK(on_call_get_status_all), ctx);
+
+ g_signal_connect(call,
+ "handle-set-sound-path",
+ G_CALLBACK(on_call_set_sound_path), ctx);
+
+ g_signal_connect(call,
+ "handle-get-sound-volume-level",
+ G_CALLBACK(on_call_get_sound_volume_level), ctx);
+
+ g_signal_connect(call,
+ "handle-set-sound-volume-level",
+ G_CALLBACK(on_call_set_sound_volume_level), ctx);
+
+ g_signal_connect(call,
+ "handle-get-sound-mute-status",
+ G_CALLBACK(on_call_get_sound_mute_status), ctx);
+
+ g_signal_connect(call,
+ "handle-set-sound-mute-status",
+ G_CALLBACK(on_call_set_sound_mute_status), ctx);
+
+ g_signal_connect(call,
+ "handle-set-sound-recording",
+ G_CALLBACK(on_call_set_sound_recording), ctx);
+
+ g_signal_connect(call,
+ "handle-set-sound-equalization",
+ G_CALLBACK(on_call_set_sound_equalization), ctx);
+
+ g_signal_connect(call,
+ "handle-set-sound-noise-reduction",
+ G_CALLBACK(on_call_set_sound_noise_reduction), ctx);
+
+ g_signal_connect(call,
+ "handle-set-sound-clock-status",
+ G_CALLBACK(on_call_set_sound_clock_status), ctx);
+
+ g_signal_connect(call,
+ "handle-set-preferred-voice-subscription",
+ G_CALLBACK(on_call_set_preferred_voice_subscription), ctx);
+
+ g_signal_connect(call,
+ "handle-get-preferred-voice-subscription",
+ G_CALLBACK(on_call_get_preferred_voice_subscription), ctx);
+
+ g_signal_connect(call,
+ "handle-modify",
+ G_CALLBACK(on_call_modify), ctx);
+
+ g_signal_connect(call,
+ "handle-confirm-modify",
+ G_CALLBACK(on_call_confirm_modify), ctx);
+
+ return TRUE;
+}
+
+gboolean dbus_plugin_call_response(struct custom_data *ctx,
+ UserRequest *ur, struct dbus_request_info *dbus_info,
+ enum tcore_response_command command, unsigned int data_len, const void *data)
+{
+ char *cpname = dbus_info ? GET_CP_NAME(dbus_info->invocation) : "";
+
+ switch (command) {
+ case TRESP_CALL_DIAL: {
+ struct tresp_call_dial *resp = (struct tresp_call_dial *)data;
+
+ dbg("[%s] CALL_DIAL - Result: [%d]",
+ cpname, resp->err);
+
+ telephony_call_complete_dial(dbus_info->interface_object,
+ dbus_info->invocation, resp->err);
+ }
+ break;
+
+ case TRESP_CALL_ANSWER: {
+ struct tresp_call_answer *resp = (struct tresp_call_answer *)data;
+
+ dbg("[%s] CALL_ANSWER - Result: [%d] Call handle: [%d]",
+ cpname, resp->err, resp->handle);
+
+ telephony_call_complete_answer(dbus_info->interface_object,
+ dbus_info->invocation, resp->err, resp->handle);
+ }
+ break;
+
+ case TRESP_CALL_END: {
+ struct tresp_call_end *resp = (struct tresp_call_end *)data;
+
+ dbg("[%s] CALL_END - Result: [%d] Call handle: [%d] End type: [%d]",
+ cpname, resp->err, resp->handle, resp->type);
+
+ telephony_call_complete_end(dbus_info->interface_object,
+ dbus_info->invocation, resp->err, resp->handle, resp->type);
+ }
+ break;
+
+ case TRESP_CALL_HOLD: {
+ struct tresp_call_hold *resp = (struct tresp_call_hold *)data;
+
+ dbg("[%s] CALL_HOLD - Result: [%d] Call handle: [%d]",
+ cpname, resp->err, resp->handle);
+
+ telephony_call_complete_hold(dbus_info->interface_object,
+ dbus_info->invocation, resp->err, resp->handle);
+ }
+ break;
+
+ case TRESP_CALL_ACTIVE: {
+ struct tresp_call_active *resp = (struct tresp_call_active *)data;
+
+ dbg("[%s] CALL_ACTIVE - Result: [%d] Call handle: [%d]",
+ cpname, resp->err, resp->handle);
+
+ telephony_call_complete_active(dbus_info->interface_object,
+ dbus_info->invocation, resp->err, resp->handle);
+ }
+ break;
+
+ case TRESP_CALL_SWAP: {
+ struct tresp_call_swap *resp = (struct tresp_call_swap *)data;
+
+ dbg("[%s] CALL_SWAP - Result: [%d] Call handle: [%d]",
+ cpname, resp->err, resp->handle);
+
+ telephony_call_complete_swap(dbus_info->interface_object,
+ dbus_info->invocation, resp->err, resp->handle);
+ }
+ break;
+
+ case TRESP_CALL_JOIN: {
+ struct tresp_call_join *resp = (struct tresp_call_join *)data;
+
+ dbg("[%s] CALL_JOIN - Result: [%d] Call handle: [%d]",
+ cpname, resp->err, resp->handle);
+
+ telephony_call_complete_join(dbus_info->interface_object,
+ dbus_info->invocation, resp->err, resp->handle);
+ }
+ break;
+
+ case TRESP_CALL_SPLIT: {
+ struct tresp_call_split *resp = (struct tresp_call_split *)data;
+
+ dbg("[%s] CALL_SPLIT - Result: [%d] Call handle: [%d]",
+ cpname, resp->err, resp->handle);
+
+ telephony_call_complete_split(dbus_info->interface_object,
+ dbus_info->invocation, resp->err, resp->handle);
+ }
+ break;
+
+ case TRESP_CALL_DEFLECT: {
+ struct tresp_call_deflect *resp = (struct tresp_call_deflect *)data;
+
+ dbg("[%s] CALL_DEFLECT - Result: [%d] Call handle: [%d]",
+ cpname, resp->err, resp->handle);
+
+ telephony_call_complete_deflect(dbus_info->interface_object,
+ dbus_info->invocation, resp->err);
+ }
+ break;
+
+ case TRESP_CALL_TRANSFER: {
+ struct tresp_call_transfer *resp = (struct tresp_call_transfer *)data;
+
+ dbg("[%s] CALL_TRANSFER - Result: [%d] Call handle: [%d]",
+ cpname, resp->err, resp->handle);
+
+ telephony_call_complete_transfer(dbus_info->interface_object,
+ dbus_info->invocation, resp->err, resp->handle);
+ }
+ break;
+
+ case TRESP_CALL_START_CONT_DTMF: {
+ struct tresp_call_dtmf *resp = (struct tresp_call_dtmf *)data;
+
+ dbg("[%s] CALL_START_CONT_DTMF - Result: [%d]", cpname, resp->err);
+
+ telephony_call_complete_start_cont_dtmf(dbus_info->interface_object,
+ dbus_info->invocation, resp->err);
+ }
+ break;
+
+ case TRESP_CALL_STOP_CONT_DTMF: {
+ struct tresp_call_dtmf *resp = (struct tresp_call_dtmf *)data;
+
+ dbg("[%s] CALL_STOP_CONT_DTMF - Result: [%d]", cpname, resp->err);
+
+ telephony_call_complete_stop_cont_dtmf(dbus_info->interface_object,
+ dbus_info->invocation, resp->err);
+ }
+ break;
+
+ case TRESP_CALL_SEND_BURST_DTMF: {
+ struct tresp_call_dtmf *resp = (struct tresp_call_dtmf *)data;
+
+ dbg("[%s] CALL_SEND_BURST_DTMF - Result: [%d]", cpname, resp->err);
+
+ telephony_call_complete_send_burst_dtmf(dbus_info->interface_object,
+ dbus_info->invocation, resp->err);
+ }
+ break;
+
+ case TRESP_CALL_GET_PRIVACY_MODE: {
+ struct tresp_call_get_voice_privacy_mode *resp = (struct tresp_call_get_voice_privacy_mode *)data;
+
+ dbg("[%s] CALL_GET_PRIVACY_MODE - Result: [%d] Privacy mode: [%d]",
+ cpname, resp->err, resp->privacy_mode);
+
+ telephony_call_complete_get_privacy_mode(dbus_info->interface_object,
+ dbus_info->invocation, resp->err, resp->privacy_mode);
+ }
+ break;
+
+ case TRESP_CALL_SET_PRIVACY_MODE: {
+ struct tresp_call_set_voice_privacy_mode *resp = (struct tresp_call_set_voice_privacy_mode *)data;
+
+ dbg("[%s] CALL_SET_PRIVACY_MODE - Result: [%d]", cpname, resp->err);
+
+ telephony_call_complete_set_privacy_mode(dbus_info->interface_object,
+ dbus_info->invocation, resp->err);
+ }
+ break;
+
+ case TRESP_CALL_SET_SOUND_PATH: {
+ struct tresp_call_set_sound_path *resp = (struct tresp_call_set_sound_path *)data;
+
+ dbg("[%s] CALL_SET_SOUND_PATH - Result: [%d]", cpname, resp->err);
+
+ telephony_call_complete_set_sound_path(dbus_info->interface_object,
+ dbus_info->invocation, resp->err);
+ }
+ break;
+
+ case TRESP_CALL_SET_SOUND_VOLUME_LEVEL: {
+ struct tresp_call_set_sound_volume_level *resp = (struct tresp_call_set_sound_volume_level *)data;
+
+ dbg("[%s] CALL_SET_SOUND_VOLUME_LEVEL - Result: [%d]", cpname, resp->err);
+
+ telephony_call_complete_set_sound_volume_level(dbus_info->interface_object,
+ dbus_info->invocation, resp->err);
+ }
+ break;
+
+ case TRESP_CALL_GET_SOUND_VOLUME_LEVEL: {
+ struct tresp_call_get_sound_volume_level *resp = (struct tresp_call_get_sound_volume_level *)data;
+ GVariant *result = 0;
+ GVariantBuilder b;
+ int i = 0;
+
+ dbg("[%s] CALL_GET_SOUND_VOLUME_LEVEL - Result: [%d]", cpname, resp->err);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+
+ g_variant_builder_add(&b, "{sv}", "err",
+ g_variant_new_int32(resp->err));
+ if (!resp->err) {
+ dbg("resp->record_num : [%d]", resp->record_num);
+
+ for (i = 0; i < resp->record_num; i++) {
+ dbg("sound_type : [%d], level:[%d]",
+ resp->record[i].sound, resp->record[i].volume);
+ g_variant_builder_add(&b, "{sv}", "type",
+ g_variant_new_int32(resp->record[i].sound));
+ g_variant_builder_add(&b, "{sv}", "level",
+ g_variant_new_int32(resp->record[i].volume));
+ }
+ }
+ g_variant_builder_close(&b);
+ result = g_variant_builder_end(&b);
+
+ telephony_call_complete_get_sound_volume_level(dbus_info->interface_object,
+ dbus_info->invocation, result, resp->err);
+ }
+ break;
+
+ case TRESP_CALL_SET_SOUND_MUTE_STATUS: {
+ struct tresp_call_set_sound_mute_status *resp = (struct tresp_call_set_sound_mute_status *)data;
+
+ dbg("[%s] CALL_SET_SOUND_MUTE_STATUS - Result: [%d]", cpname, resp->err);
+
+ telephony_call_complete_set_sound_mute_status(dbus_info->interface_object,
+ dbus_info->invocation, resp->err);
+ }
+ break;
+
+ case TRESP_CALL_GET_SOUND_MUTE_STATUS: {
+ struct tresp_call_get_sound_mute_status *resp = (struct tresp_call_get_sound_mute_status *)data;
+
+ dbg("[%s] CALL_GET_SOUND_MUTE_STATUS - Result: [%d] Path: [%d] Status: [%d]",
+ cpname, resp->err, resp->path, resp->status);
+
+ telephony_call_complete_get_sound_mute_status(dbus_info->interface_object,
+ dbus_info->invocation, resp->err, resp->path, resp->status);
+
+ }
+ break;
+
+ case TRESP_CALL_SET_SOUND_RECORDING: {
+ struct tresp_call_set_sound_recording *resp = (struct tresp_call_set_sound_recording *)data;
+
+ dbg("[%s] CALL_SET_SOUND_RECORDING - Result: [%d]", cpname, resp->err);
+
+ telephony_call_complete_set_sound_recording(dbus_info->interface_object,
+ dbus_info->invocation, resp->err);
+
+ }
+ break;
+
+ case TRESP_CALL_SET_SOUND_EQUALIZATION: {
+ struct tresp_call_set_sound_equalization *resp = (struct tresp_call_set_sound_equalization *)data;
+
+ dbg("[%s] CALL_SET_SOUND_EQUALIZATION - Result: [%d]", cpname, resp->err);
+
+ telephony_call_complete_set_sound_equalization(dbus_info->interface_object,
+ dbus_info->invocation, resp->err);
+ }
+ break;
+
+ case TRESP_CALL_SET_SOUND_NOISE_REDUCTION: {
+ struct tresp_call_set_sound_noise_reduction *resp = (struct tresp_call_set_sound_noise_reduction *)data;
+
+ dbg("[%s] CALL_SET_SOUND_NOISE_REDUCTION - Result: [%d]", cpname, resp->err);
+
+ telephony_call_complete_set_sound_noise_reduction(dbus_info->interface_object,
+ dbus_info->invocation, resp->err);
+ }
+ break;
+
+ case TRESP_CALL_SET_SOUND_CLOCK_STATUS: {
+ struct tresp_call_set_sound_clock_status *resp = (struct tresp_call_set_sound_clock_status *)data;
+
+ dbg("[%s] CALL_SET_SOUND_CLOCK_STATUS - Result: [%d]", cpname, resp->err);
+
+ telephony_call_complete_set_sound_clock_status(dbus_info->interface_object,
+ dbus_info->invocation, resp->err);
+ }
+ break;
+
+ case TRESP_CALL_SET_PREFERRED_VOICE_SUBSCRIPTION: {
+ struct tresp_call_set_preferred_voice_subscription *resp = (struct tresp_call_set_preferred_voice_subscription *)data;
+
+ dbg("[%s] CALL_SET_PREFERRED_VOICE_SUBSCRIPTION - Result: [%d]",
+ cpname, resp->err);
+
+ telephony_call_complete_set_preferred_voice_subscription(dbus_info->interface_object,
+ dbus_info->invocation, resp->err);
+ }
+ break;
+
+ case TRESP_CALL_GET_PREFERRED_VOICE_SUBSCRIPTION: {
+ struct tresp_call_get_preferred_voice_subscription *resp = (struct tresp_call_get_preferred_voice_subscription *)data;
+
+ dbg("[%s] CALL_GET_PREFERRED_VOICE_SUBSCRIPTION - Result: [%d] Preferred Subscription: [%d]",
+ cpname, resp->err, resp->preferred_subs);
+
+ telephony_call_complete_get_preferred_voice_subscription(dbus_info->interface_object,
+ dbus_info->invocation, resp->preferred_subs, resp->err);
+ }
+ break;
+
+ case TRESP_CALL_MODIFY: {
+ const struct tresp_call_modify *resp = data;
+
+ dbg("[%s] CALL_MODIFY - Result: [%d]", cpname, resp->err);
+
+ telephony_call_complete_modify(dbus_info->interface_object,
+ dbus_info->invocation, resp->err);
+ }
+ break;
+
+ case TRESP_CALL_CONFIRM_MODIFY: {
+ const struct tresp_call_confirm_modify *resp = data;
+
+ dbg("[%s] CALL_CONFIRM_MODIFY - Result: [%d]", cpname, resp->err);
+
+ telephony_call_complete_confirm_modify(dbus_info->interface_object,
+ dbus_info->invocation, resp->err);
+ }
+ break;
+
+ default:
+ err("Unhandled/Unknown Response: [0x%x]", command);
+ break;
+ }
+
+ return TRUE;
+}
+
+gboolean dbus_plugin_call_notification(struct custom_data *ctx,
+ CoreObject *source, TelephonyObjectSkeleton *object,
+ enum tcore_notification_command command, unsigned int data_len, const void *data)
+{
+ TelephonyCall *call;
+ char *cp_name;
+
+ if (!object) {
+ dbg("object is NULL");
+ return FALSE;
+ }
+
+ if (!data) {
+ err("data is NULL");
+ return FALSE;
+ }
+
+ cp_name = (char *)tcore_server_get_cp_name_by_plugin(tcore_object_ref_plugin(source));
+
+ call = telephony_object_peek_call(TELEPHONY_OBJECT(object));
+ if (call == NULL) {
+ err("call object is NULL!!!");
+ return FALSE;
+ }
+
+ switch (command) {
+ case TNOTI_CALL_STATUS_IDLE: {
+ struct tnoti_call_status_idle *idle = (struct tnoti_call_status_idle *)data;
+
+ dbg("[%s] CALL_STATUS_IDLE: [%s]", cp_name,
+ (idle->type != CALL_TYPE_VIDEO ? "Voice" : "Video"));
+
+ if (idle->type != CALL_TYPE_VIDEO)
+ telephony_call_emit_voice_call_status_idle(call,
+ idle->handle, idle->cause, 0, 0);
+ else
+ telephony_call_emit_video_call_status_idle(call,
+ idle->handle, idle->cause, 0, 0);
+ }
+ break;
+
+ case TNOTI_CALL_STATUS_DIALING: {
+ struct tnoti_call_status_dialing *dialing = (struct tnoti_call_status_dialing *)data;
+
+ dbg("[%s] CALL_STATUS_DIALING: [%s] Call handle: [%d]", cp_name,
+ (dialing->type != CALL_TYPE_VIDEO ? "Voice" : "Video"),
+ dialing->handle);
+
+ if (dialing->type != CALL_TYPE_VIDEO)
+ telephony_call_emit_voice_call_status_dialing(call, dialing->handle);
+ else
+ telephony_call_emit_video_call_status_dialing(call, dialing->handle);
+ }
+ break;
+
+ case TNOTI_CALL_STATUS_ALERT: {
+ struct tnoti_call_status_alert *alert = (struct tnoti_call_status_alert *)data;
+
+ dbg("[%s] CALL_STATUS_ALERT: [%s] Call handle: [%d]", cp_name,
+ (alert->type != CALL_TYPE_VIDEO ? "Voice" : "Video"),
+ alert->handle);
+
+ if (alert->type != CALL_TYPE_VIDEO)
+ telephony_call_emit_voice_call_status_alert(call, alert->handle);
+ else
+ telephony_call_emit_video_call_status_alert(call, alert->handle);
+ }
+ break;
+
+ case TNOTI_CALL_STATUS_ACTIVE: {
+ struct tnoti_call_status_active *active = (struct tnoti_call_status_active *)data;
+
+ dbg("[%s] CALL_STATUS_ACTIVE: [%s] Call handle: [%d]", cp_name,
+ (active->type != CALL_TYPE_VIDEO ? "Voice" : "Video"),
+ active->handle);
+
+ if (active->type != CALL_TYPE_VIDEO)
+ telephony_call_emit_voice_call_status_active(call, active->handle);
+ else
+ telephony_call_emit_video_call_status_active(call, active->handle);
+ }
+ break;
+
+ case TNOTI_CALL_STATUS_HELD: {
+ struct tnoti_call_status_held *held = (struct tnoti_call_status_held *)data;
+
+ dbg("[%s] CALL_STATUS_HELD: Call handle: [%d]", cp_name,
+ held->handle);
+
+ telephony_call_emit_voice_call_status_held(call, held->handle);
+ }
+ break;
+
+ case TNOTI_CALL_STATUS_INCOMING: {
+ struct tnoti_call_status_incoming *incoming = (struct tnoti_call_status_incoming *)data;
+
+ dbg("[%s] CALL_STATUS_INCOMING: [%s] Call handle: [%d]", cp_name,
+ (incoming->type != CALL_TYPE_VIDEO ? "Voice" : "Video"),
+ incoming->handle);
+
+ if (incoming->type != CALL_TYPE_VIDEO)
+ telephony_call_emit_voice_call_status_incoming(call,
+ incoming->handle,
+ incoming->cli.mode,
+ incoming->cli.no_cli_cause,
+ incoming->cli.number,
+ incoming->forward,
+ incoming->active_line,
+ incoming->cna.name);
+ else
+ telephony_call_emit_video_call_status_incoming(call,
+ incoming->handle,
+ incoming->cli.mode,
+ incoming->cli.no_cli_cause,
+ incoming->cli.number,
+ incoming->forward,
+ incoming->active_line,
+ incoming->cna.name);
+ }
+ break;
+
+ case TNOTI_CALL_INFO_WAITING: {
+ int *id = (int *)data;
+
+ dbg("[%s] CALL_INFO_WAITING: Call handle: [%d]",
+ cp_name, (gint)*id);
+
+ telephony_call_emit_waiting(call, (gint)*id);
+ }
+ break;
+
+ case TNOTI_CALL_INFO_FORWARDED: {
+ int *id = (int *)data;
+
+ dbg("[%s] CALL_INFO_FORWARDED: Call handle: [%d]",
+ cp_name, (gint)*id);
+
+ telephony_call_emit_forwarded(call, (gint)*id);
+ }
+ break;
+
+ case TNOTI_CALL_INFO_FORWARDED_CALL: {
+ int *id = (int *)data;
+
+ dbg("[%s] CALL_INFO_FORWARDED_CALL: Call handle: [%d]",
+ cp_name, (gint)*id);
+
+ telephony_call_emit_forwarded_call(call, (gint)*id);
+ }
+ break;
+
+ case TNOTI_CALL_INFO_BARRED_INCOMING: {
+ int *id = (int *)data;
+
+ dbg("[%s] CALL_INFO_BARRED_INCOMING: Call handle: [%d]",
+ cp_name, (gint)*id);
+
+ telephony_call_emit_barred_incoming(call, (gint)*id);
+ }
+ break;
+
+ case TNOTI_CALL_INFO_BARRED_OUTGOING: {
+ int *id = (int *)data;
+
+ dbg("[%s] CALL_INFO_BARRED_OUTGOING: Call handle: [%d]",
+ cp_name, (gint)*id);
+
+ telephony_call_emit_barred_outgoing(call, (gint)*id);
+ }
+ break;
+
+ case TNOTI_CALL_INFO_FORWARD_CONDITIONAL: {
+ int *id = (int *)data;
+
+ dbg("[%s] CALL_INFO_FORWARD_CONDITIONAL: Call handle: [%d]",
+ cp_name, (gint)*id);
+
+ telephony_call_emit_forward_conditional(call, (gint)*id);
+ }
+ break;
+
+ case TNOTI_CALL_INFO_FORWARD_UNCONDITIONAL: {
+ int *id = (int *)data;
+
+ dbg("[%s] CALL_INFO_FORWARD_UNCONDITIONAL: Call handle: [%d]",
+ cp_name, (gint)*id);
+
+ telephony_call_emit_forward_unconditional(call, (gint)*id);
+ }
+ break;
+
+ case TNOTI_CALL_INFO_HELD: {
+ int *id = (int *)data;
+
+ dbg("[%s] CALL_INFO_HELD: Call handle: [%d]",
+ cp_name, (gint)*id);
+
+ telephony_call_emit_call_held(call, (gint)*id);
+ }
+ break;
+
+ case TNOTI_CALL_INFO_ACTIVE: {
+ int *id = (int *)data;
+
+ dbg("[%s] CALL_INFO_ACTIVE: Call handle: [%d]",
+ cp_name, (gint)*id);
+
+ telephony_call_emit_call_active(call, (gint)*id);
+ }
+ break;
+
+ case TNOTI_CALL_INFO_JOINED: {
+ int *id = (int *)data;
+
+ dbg("[%s] CALL_INFO_JOINED: Call handle: [%d]",
+ cp_name, (gint)*id);
+
+ telephony_call_emit_call_joined(call, (gint)*id);
+ }
+ break;
+
+ case TNOTI_CALL_INFO_PRIVACY_MODE: {
+ struct tnoti_call_info_voice_privacy_mode *privacy_info = (struct tnoti_call_info_voice_privacy_mode *)data;
+
+ dbg("[%s] CALL_INFO_PRIVACY_MODE: Privacy mode: [%d]",
+ cp_name, privacy_info->privacy_mode);
+
+ telephony_call_emit_call_privacy_mode(call, privacy_info->privacy_mode);
+ }
+ break;
+
+ case TNOTI_CALL_OTASP_STATUS: {
+ struct tnoti_call_otasp_status *otasp = (struct tnoti_call_otasp_status *)data;
+
+ dbg("[%s] CALL_OTASP_STATUS : status(%d)",
+ cp_name, otasp->otasp_status);
+
+ telephony_call_emit_call_otasp_status(call, otasp->otasp_status);
+ }
+ break;
+
+ case TNOTI_CALL_OTAPA_STATUS: {
+ struct tnoti_call_otapa_status *otapa = (struct tnoti_call_otapa_status *)data;
+
+ dbg("[%s] CALL_OTAPA_STATUS: Status: [%d]",
+ cp_name, otapa->otapa_status);
+
+ telephony_call_emit_call_otapa_status(call, otapa->otapa_status);
+ }
+ break;
+
+ case TNOTI_CALL_SIGNAL_INFO: {
+ struct tnoti_call_signal_info *sig_info = (struct tnoti_call_signal_info *)data;
+ unsigned int signal;
+
+ if (sig_info->signal_type == CALL_SIGNAL_TYPE_TONE) {
+ signal = sig_info->signal.sig_tone_type;
+ } else if (sig_info->signal_type == CALL_SIGNAL_TYPE_ISDN_ALERTING) {
+ signal = sig_info->signal.sig_isdn_alert_type;
+ } else if (sig_info->signal_type == CALL_SIGNAL_TYPE_IS54B_ALERTING) {
+ signal = sig_info->signal.sig_is54b_alert_type;
+ } else {
+ err("Unknown Signal type");
+ return FALSE;
+ }
+
+ dbg("[%s] CALL_SIGNAL_INFO: Signal type: [%d] Pitch type: [%d] Signal: [%d]",
+ cp_name, sig_info->signal_type, sig_info->pitch_type, signal);
+
+ telephony_call_emit_call_signal_info(call,
+ sig_info->signal_type, sig_info->pitch_type, signal);
+ }
+ break;
+
+ case TNOTI_CALL_INFO_REC: {
+ struct tnoti_call_info_rec *noti = (struct tnoti_call_info_rec *)data;
+ gchar *param = NULL;
+
+ if (noti->rec_info.type == CALL_REC_NAME_INFO) {
+ param = g_strdup(noti->rec_info.data.name);
+ } else if (noti->rec_info.type == CALL_REC_NUMBER_INFO) {
+ param = g_strdup(noti->rec_info.data.number);
+ } else {
+ err("Unknown rec info type (%d)", noti->rec_info.type);
+ return FALSE;
+ }
+
+ dbg("[%s] CALL_INFO_REC: id: [%d] type: [%d] param: [%s]",
+ cp_name, noti->rec_info.handle, noti->rec_info.type, param);
+
+ telephony_call_emit_call_info_rec(call, noti->rec_info.handle, noti->rec_info.type, param);
+ g_free(param);
+ }
+ break;
+
+ case TNOTI_CALL_SOUND_PATH: {
+ struct tnoti_call_sound_path *noti = (struct tnoti_call_sound_path *)data;
+
+ dbg("[%s] CALL_SOUND_PATH: Path: [%d]", cp_name, noti->path);
+
+ telephony_call_emit_call_sound_path(call, noti->path);
+ }
+ break;
+
+ case TNOTI_CALL_SOUND_RINGBACK_TONE: {
+ struct tnoti_call_sound_ringback_tone *noti = (struct tnoti_call_sound_ringback_tone *)data;
+
+ dbg("[%s] CALL_SOUND_RINGBACK_TONE: Status: [%d]",
+ cp_name, (gint)noti->status);
+
+ telephony_call_emit_call_sound_ringback_tone(call, (gint)noti->status);
+ }
+ break;
+
+ case TNOTI_CALL_SOUND_WBAMR: {
+ struct tnoti_call_sound_wbamr *noti = (struct tnoti_call_sound_wbamr *)data;
+
+ dbg("[%s] CALL_SOUND_WBAMR: Status: [%d]",
+ cp_name, (gint)noti->status);
+
+ telephony_call_emit_call_sound_wbamr(call, (gint)noti->status);
+ }
+ break;
+
+ case TNOTI_CALL_SOUND_EQUALIZATION: {
+ struct tnoti_call_sound_equalization *noti = (struct tnoti_call_sound_equalization *)data;
+
+ dbg("[%s] CALL_SOUND_EQUALIZATION: Direction: [%d]",
+ cp_name, (gint)noti->direction);
+
+ telephony_call_emit_call_sound_equalization(call, (gint)noti->mode, (gint)noti->direction);
+ }
+ break;
+
+ case TNOTI_CALL_SOUND_NOISE_REDUCTION: {
+ struct tnoti_call_sound_noise_reduction *noti = (struct tnoti_call_sound_noise_reduction *)data;
+
+ dbg("[%s] CALL_SOUND_NOISE_REDUCTION: Status: [%d]",
+ cp_name, (gint)noti->status);
+
+ telephony_call_emit_call_sound_noise_reduction(call, (gint)noti->status);
+ }
+ break;
+
+ case TNOTI_CALL_SOUND_CLOCK_STATUS: {
+ struct tnoti_call_sound_clock_status *noti = (struct tnoti_call_sound_clock_status *)data;
+
+ dbg("[%s] CALL_SOUND_CLOCK_STATUS: Status: [%d]",
+ cp_name, (gint)noti->status);
+
+ telephony_call_emit_call_sound_clock_status(call, noti->status);
+ }
+ break;
+
+ case TNOTI_CALL_PREFERRED_VOICE_SUBSCRIPTION: {
+ struct tnoti_call_preferred_voice_subscription *noti = (struct tnoti_call_preferred_voice_subscription *)data;
+
+ dbg("[%s] CALL_PREFERRED_VOICE_SUBSCRIPTION: Subscription: [%d]",
+ cp_name, noti->preferred_subs);
+
+ telephony_call_emit_call_preferred_voice_subscription(call, noti->preferred_subs);
+ }
+ break;
+
+ case TNOTI_CALL_MODIFY_REQUEST: {
+ const struct tnoti_call_modify_request *noti = data;
+
+ dbg("[%s] CALL_MODIFY_REQUEST: Call handle: [%d] Call type: [%d]",
+ cp_name, noti->handle, noti->call_type);
+
+ telephony_call_emit_call_modify_request(call, noti->handle, noti->call_type);
+ }
+ break;
+
+ case TNOTI_CALL_INFO_FALLBACK:{
+ struct tnoti_call_fallback* noti = (struct tnoti_call_fallback *)data;
+
+ dbg("[%s] CALL_INFO_FALLBACK: Call handle: [%d] Fallback to: [%d]",
+ cp_name, noti->handle, noti->fallback_to);
+
+ telephony_call_emit_call_fallback(call, noti->handle, noti->fallback_to);
+ }
+ break;
+
+ default:
+ err("Unhandled/Unknown Notification: [0x%x]", command);
+ break;
+ }
+
+ return TRUE;
+}
#include <libxml/tree.h>
#include "generated-code.h"
-#include "common.h"
-
+#include "dtapi_common.h"
static void _free_hook(UserRequest *ur)
{
if (!object_path)
return NULL;
- if (!g_str_has_prefix(object_path, MY_DBUS_PATH)) {
+ if (!g_str_has_prefix(object_path, MY_DBUS_PATH))
return NULL;
- }
return (char *)object_path + strlen(MY_DBUS_PATH) + 1;
}
-UserRequest *dbus_plugin_macro_user_request_new(struct custom_data *ctx, void *object, GDBusMethodInvocation *invocation)
+UserRequest *dbus_plugin_macro_user_request_new(struct custom_data *ctx,
+ void *object, GDBusMethodInvocation *invocation)
{
UserRequest *ur = NULL;
char *cp_name;
struct dbus_request_info *dbus_info;
cp_name = GET_CP_NAME(invocation);
- dbg("cp_name = [%s]", cp_name);
-
- ur = tcore_user_request_new(ctx->comm, cp_name);
dbus_info = calloc(1, sizeof(struct dbus_request_info));
if (!dbus_info)
return NULL;
+ ur = tcore_user_request_new(ctx->comm, cp_name);
+
dbus_info->interface_object = object;
dbus_info->invocation = invocation;
return ur;
}
-gboolean check_access_control (GDBusMethodInvocation *invoc, const char *label, const char *perm)
+gboolean check_access_control(GDBusMethodInvocation *invoc, const char *label, const char *perm)
{
GDBusConnection *conn;
GVariant *result_pid;
int ret;
int result = FALSE;
- conn = g_dbus_method_invocation_get_connection (invoc);
+ conn = g_dbus_method_invocation_get_connection(invoc);
if (!conn) {
- warn ("access control denied (no connection info)");
+ warn("access control denied (no connection info)");
goto OUT;
}
- sender = g_dbus_method_invocation_get_sender (invoc);
+ sender = g_dbus_method_invocation_get_sender(invoc);
- param = g_variant_new ("(s)", sender);
+ param = g_variant_new("(s)", sender);
if (!param) {
- warn ("access control denied (sender info fail)");
+ warn("access control denied (sender info fail)");
goto OUT;
}
- result_pid = g_dbus_connection_call_sync (conn, "org.freedesktop.DBus",
+ result_pid = g_dbus_connection_call_sync(conn, "org.freedesktop.DBus",
"/org/freedesktop/DBus",
"org.freedesktop.DBus",
"GetConnectionUnixProcessID",
param, NULL,
G_DBUS_CALL_FLAGS_NONE, -1, NULL, &error);
if (error) {
- warn ("access control denied (dbus error: %d(%s))",
+ warn("access control denied (dbus error: %d(%s))",
error->code, error->message);
- g_error_free (error);
+ g_error_free(error);
goto OUT;
}
if (!result_pid) {
- warn ("access control denied (fail to get pid)");
+ warn("access control denied (fail to get pid)");
goto OUT;
}
- g_variant_get (result_pid, "(u)", &pid);
- g_variant_unref (result_pid);
+ g_variant_get(result_pid, "(u)", &pid);
+ g_variant_unref(result_pid);
- dbg ("sender: %s pid = %u", sender, pid);
+ dbg("sender: %s pid = %u", sender, pid);
- ret = security_server_check_privilege_by_pid (pid, label, perm);
- if (ret != SECURITY_SERVER_API_SUCCESS) {
- warn ("pid(%u) access (%s - %s) denied(%d)", pid, label, perm, ret);
- }
+ ret = security_server_check_privilege_by_pid(pid, label, perm);
+ if (ret != SECURITY_SERVER_API_SUCCESS)
+ warn("pid(%u) access (%s - %s) denied(%d)", pid, label, perm, ret);
else
result = TRUE;
OUT:
if (result == FALSE) {
- g_dbus_method_invocation_return_error (invoc,
- G_DBUS_ERROR,
- G_DBUS_ERROR_ACCESS_DENIED,
- "No access rights");
+ g_dbus_method_invocation_return_error(invoc,
+ G_DBUS_ERROR,
+ G_DBUS_ERROR_ACCESS_DENIED,
+ "No access rights");
}
return result;
}
-enum dbus_tapi_sim_slot_id get_sim_slot_id_by_cp_name(char *cp_name)
+enum dbus_tapi_sim_slot_id get_sim_slot_id_by_cp_name(const char *cp_name)
{
- if(g_str_has_suffix(cp_name , "0")){
+ if (g_str_has_suffix(cp_name , "0"))
return SIM_SLOT_PRIMARY;
- } else if (g_str_has_suffix(cp_name , "1")){
+ else if (g_str_has_suffix(cp_name , "1"))
return SIM_SLOT_SECONDARY;
- } else if(g_str_has_suffix(cp_name , "2")){
+ else if (g_str_has_suffix(cp_name , "2"))
return SIM_SLOT_TERTIARY;
- }
return SIM_SLOT_PRIMARY;
}
if (0 == xmlStrcmp((*root_node)->name, (const xmlChar *) groupname)) {
*root_node = (*root_node)->xmlChildrenNode;
return TRUE;
- }
+ }
*root_node = NULL;
}
}
*root_node = NULL;
}
}
+
+TReturn dtapi_dispatch_request_ex(struct custom_data *ctx,
+ void *object, GDBusMethodInvocation *invocation,
+ enum tcore_request_command req_command,
+ void *req_data, unsigned int req_data_len)
+{
+ UserRequest *ur;
+ TReturn ret;
+
+ ur = MAKE_UR(ctx, object, invocation);
+
+ if (req_data_len)
+ tcore_user_request_set_data(ur, req_data_len, req_data);
+ tcore_user_request_set_command(ur, req_command);
+
+ ret = tcore_communicator_dispatch_request(ctx->comm, ur);
+ if (ret != TCORE_RETURN_SUCCESS) {
+ err("tcore_communicator_dispatch_request() : (0x%x)", ret);
+
+ tcore_user_request_unref(ur);
+ }
+
+ return ret;
+}
+
+void dtapi_dispatch_request(struct custom_data *ctx,
+ void *object, GDBusMethodInvocation *invocation,
+ enum tcore_request_command req_command,
+ void *req_data, unsigned int req_data_len)
+{
+ TReturn ret;
+
+ ret = dtapi_dispatch_request_ex(ctx, object, invocation,
+ req_command, req_data, req_data_len);
+ if (ret != TCORE_RETURN_SUCCESS) {
+ err("dtapi_dispatch_request_ex() : (0x%x)", ret);
+
+ FAIL_RESPONSE(invocation, DEFAULT_MSG_REQ_FAILED);
+ }
+}
#define AC_MANAGER "telephony_framework::api_manager"
#define AC_CALL "telephony_framework::api_call"
-#define AC_GPS "telephony_framework::api_gps"
#define AC_MODEM "telephony_framework::api_modem"
#define AC_NETWORK "telephony_framework::api_network"
-#define AC_PHONEBOOK "telephony_framework::api_phonebook"
+#define AC_PHONEBOOK "telephony_framework::api_phonebook"
#define AC_SAP "telephony_framework::api_sap"
#define AC_SAT "telephony_framework::api_sat"
#define AC_SIM "telephony_framework::api_sim"
#define AC_SMS "telephony_framework::api_sms"
#define AC_SS "telephony_framework::api_ss"
-#define MY_DBUS_PATH "/org/tizen/telephony"
+#define MY_DBUS_PATH "/org/tizen/telephony"
#define MY_DBUS_SERVICE "org.tizen.telephony"
enum dbus_tapi_sim_slot_id {
#define DEFAULT_MSG_REQ_FAILED "Request failed"
#define GET_CP_NAME(invocation) dbus_plugin_get_cp_name_by_object_path(g_dbus_method_invocation_get_object_path(invocation))
-#define MAKE_UR(ctx,object,invocation) dbus_plugin_macro_user_request_new(ctx, object, invocation)
-#define FAIL_RESPONSE(ivc,msg) g_dbus_method_invocation_return_error (ivc, \
- G_DBUS_ERROR, G_DBUS_ERROR_FAILED, msg);
+#define MAKE_UR(ctx, object, invocation) dbus_plugin_macro_user_request_new(ctx, object, invocation)
+#define FAIL_RESPONSE(ivc, msg) g_dbus_method_invocation_return_error (ivc, \
+ G_DBUS_ERROR, G_DBUS_ERROR_FAILED, msg);
+
+gboolean dtapi_init(TcorePlugin *p);
+void dtapi_deinit(TcorePlugin *p);
char *dbus_plugin_get_cp_name_by_object_path(const char *object_path);
UserRequest *dbus_plugin_macro_user_request_new(struct custom_data *ctx, void *object, GDBusMethodInvocation *invocation);
-gboolean check_access_control (GDBusMethodInvocation *invoc, const char *label, const char *perm);
+gboolean check_access_control(GDBusMethodInvocation *invoc, const char *label, const char *perm);
gboolean dbus_plugin_util_load_xml(char *docname, char *groupname, void **i_doc, void **i_root_node);
void dbus_plugin_util_unload_xml(void **i_doc, void **i_root_node);
+void dtapi_dispatch_request(struct custom_data *ctx,
+ void *object, GDBusMethodInvocation *invocation,
+ enum tcore_request_command req_command,
+ void *req_data, unsigned int req_data_len);
+TReturn dtapi_dispatch_request_ex(struct custom_data *ctx,
+ void *object, GDBusMethodInvocation *invocation,
+ enum tcore_request_command req_command,
+ void *req_data, unsigned int req_data_len);
+
gboolean dbus_plugin_setup_network_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
gboolean dbus_plugin_network_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data);
gboolean dbus_plugin_network_notification(struct custom_data *ctx, CoreObject *source, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
gboolean dbus_plugin_modem_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data);
gboolean dbus_plugin_modem_notification(struct custom_data *ctx, CoreObject *source, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
-gboolean dbus_plugin_setup_gps_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
-gboolean dbus_plugin_gps_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data);
-gboolean dbus_plugin_gps_notification(struct custom_data *ctx, CoreObject *source, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
-
gboolean dbus_plugin_setup_oem_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
gboolean dbus_plugin_oem_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data);
gboolean dbus_plugin_oem_notification(struct custom_data *ctx, CoreObject *source, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
-enum dbus_tapi_sim_slot_id get_sim_slot_id_by_cp_name(char *cp_name);
+enum dbus_tapi_sim_slot_id get_sim_slot_id_by_cp_name(const char *cp_name);
-#endif
+#endif /* __COMMON_H__ */
#include <stdio.h>
#include <string.h>
-#include <pthread.h>
-#include <unistd.h>
#include <stdlib.h>
#include <time.h>
+
#include <glib.h>
#include <gio/gio.h>
#include <tcore.h>
#include <server.h>
#include <plugin.h>
-#include <hal.h>
#include <communicator.h>
#include <storage.h>
-#include <queue.h>
#include <user_request.h>
#include <co_network.h>
#include <co_sim.h>
#include <co_ps.h>
-#include "sat_ui_support.h"
+#include "generated-code.h"
+#include "dtapi_common.h"
-#ifndef PLUGIN_VERSION
-#define PLUGIN_VERSION 1
-#endif
+static void __dtapi_initialize_properties(CoreObject *source,
+ TelephonyObjectSkeleton *object)
+{
+ TelephonyNetwork *network;
+ TelephonyModem *modem;
+ TelephonySim *sim;
-#include "generated-code.h"
-#include "common.h"
+ if (!object) {
+ err("object is NULL");
+ return;
+ }
+
+ /* initialize network dbus properties */
+ network = telephony_object_peek_network(TELEPHONY_OBJECT(object));
+ if (network == NULL) {
+ err("Network object is NULL!!!");
+ } else {
+ telephony_network_set_access_technology(network, NETWORK_ACT_UNKNOWN);
+ telephony_network_set_cell_id(network, 0);
+ telephony_network_set_ims_voice_status(network, NETWORK_IMS_VOICE_UNKNOWN);
+ telephony_network_set_circuit_status(network, NETWORK_SERVICE_DOMAIN_STATUS_NO);
+ telephony_network_set_lac(network, 0);
+ telephony_network_set_name_option(network, NETWORK_NAME_OPTION_NONE);
+ telephony_network_set_packet_status(network, NETWORK_SERVICE_DOMAIN_STATUS_NO);
+ telephony_network_set_sig_dbm(network, 0);
+ telephony_network_set_roaming_status(network, FALSE);
+ telephony_network_set_ps_type(network, TELEPHONY_HSDPA_OFF);
+ telephony_network_set_service_type(network, NETWORK_SERVICE_TYPE_UNKNOWN);
+ telephony_network_set_sig_level(network, 0);
+ telephony_network_set_plmn(network, NULL);
+ telephony_network_set_spn_name(network, NULL);
+ telephony_network_set_network_name(network, NULL);
+ }
-static void add_modem(struct custom_data *ctx, TcorePlugin *p)
+ /* initialize modem dbus properties */
+ modem = telephony_object_peek_modem(TELEPHONY_OBJECT(object));
+ if (modem == NULL) {
+ err("Modem object is NULL!!!");
+ } else {
+ telephony_modem_set_dongle_status(modem, 0);
+ telephony_modem_set_dongle_login(modem, 0);
+ telephony_modem_set_power(modem, MODEM_STATE_UNKNOWN);
+ }
+
+ /* initialize sim dbus properties */
+ sim = telephony_object_peek_sim(TELEPHONY_OBJECT(object));
+ if (sim == NULL)
+ err("Sim object is NULL!!!");
+ else
+ telephony_sim_set_cf_state(sim, FALSE);
+}
+
+static void __dtapi_add_modem(struct custom_data *ctx, TcorePlugin *p)
{
TelephonyObjectSkeleton *object;
char *path = NULL;
- GSList *co_list;
+ CoreObject *co;
const char *cp_name;
- dbg("Entry");
-
/* Get CP Name */
cp_name = tcore_server_get_cp_name_by_plugin(p);
if (cp_name == NULL) {
}
path = g_strdup_printf("%s/%s", MY_DBUS_PATH, cp_name);
- dbg("PATH: [%s]", path);
object = g_hash_table_lookup(ctx->objects, path);
if (object) {
- dbg("DBUS interface object already created (object: %p)", object);
- goto OUT;
+ dbg("DBUS interface object(%p) already created (path: %s)", object, path);
+
+ /* Freeing memory */
+ g_free(path);
+
+ return;
}
object = telephony_object_skeleton_new(path);
- dbg("New DBUS object created (object: [%p])", object);
+ if (object == NULL) {
+ err("New DBUS object is NULL");
+
+ /* Freeing memory */
+ g_free(path);
+
+ return;
+ }
+
+ info("New DBUS object(%p) created (path: %s)", object, path);
g_hash_table_insert(ctx->objects, g_strdup(path), object);
- /* Add interfaces */
- co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_MODEM);
- if (co_list) {
- g_slist_free(co_list);
+ /* Freeing memory */
+ g_free(path);
+
+ /*
+ * Add interfaces
+ *
+ * Interfaces are exposed only if Core object is available (supported)
+ */
+ /* Modem interface */
+ co = tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_MODEM);
+ if (co)
dbus_plugin_setup_modem_interface(object, ctx);
- }
- co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_CALL);
- if (co_list) {
- g_slist_free(co_list);
+ /* Call interface */
+ co = tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_CALL);
+ if (co)
dbus_plugin_setup_call_interface(object, ctx);
- }
- co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_NETWORK);
- if (co_list) {
- g_slist_free(co_list);
+ /* Network interface */
+ co = tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_NETWORK);
+ if (co)
dbus_plugin_setup_network_interface(object, ctx);
- }
- co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_SS);
- if (co_list) {
- g_slist_free(co_list);
+ /* SS interface */
+ co = tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_SS);
+ if (co)
dbus_plugin_setup_ss_interface(object, ctx);
- }
- co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_SMS);
- if (co_list) {
- g_slist_free(co_list);
+ /* SMS interface */
+ co = tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_SMS);
+ if (co)
dbus_plugin_setup_sms_interface(object, ctx);
- }
- co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_SAT);
- if (co_list) {
- g_slist_free(co_list);
+ /* SAT interface */
+ co = tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_SAT);
+ if (co)
dbus_plugin_setup_sat_interface(object, ctx);
- }
- co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_PHONEBOOK);
- if (co_list) {
- g_slist_free(co_list);
+ /* Phonebook interface */
+ co = tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_PHONEBOOK);
+ if (co)
dbus_plugin_setup_phonebook_interface(object, ctx);
- }
- co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_SAP);
- if (co_list) {
- g_slist_free(co_list);
+ /* SAP interface */
+ co = tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_SAP);
+ if (co)
dbus_plugin_setup_sap_interface(object, ctx);
- }
- co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_SIM);
- if (co_list) {
- g_slist_free(co_list);
+ /* SIM interface */
+ co = tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_SIM);
+ if (co)
dbus_plugin_setup_sim_interface(object, ctx);
- }
-
- co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_GPS);
- if (co_list) {
- g_slist_free(co_list);
- dbus_plugin_setup_gps_interface(object, ctx);
- }
- dbus_plugin_setup_oem_interface(object, ctx);
- /* Export the Object to Manager */
- g_dbus_object_manager_server_export (ctx->manager, G_DBUS_OBJECT_SKELETON (object));
+ /* OEM interface */
+ co = tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_CUSTOM);
+ if (co)
+ dbus_plugin_setup_oem_interface(object, ctx);
-OUT:
- /* Freeing memory */
- g_free(path);
+ /* Export the Object to Manager */
+ g_dbus_object_manager_server_export(ctx->manager,
+ G_DBUS_OBJECT_SKELETON(object));
}
-static void refresh_object(struct custom_data *ctx)
+static void __dtapi_refresh_object(struct custom_data *ctx)
{
GSList *modem_plg_list;
TcorePlugin *modem_plg;
modem_plg_list = tcore_server_get_modem_plugin_list(ctx->server);
for (cur = modem_plg_list; cur; cur = cur->next) {
modem_plg = cur->data;
- if (modem_plg == NULL) {
- dbg("No Modem Plug-in");
- continue;
- }
-
- /* Add modem */
- add_modem(ctx, modem_plg);
+ if (modem_plg)
+ __dtapi_add_modem(ctx, modem_plg); /* Add modem */
}
g_slist_free(modem_plg_list);
}
-static TReturn send_response(Communicator *comm, UserRequest *ur, enum tcore_response_command command, unsigned int data_len, const void *data)
+static gboolean on_manager_getmodems(TelephonyManager *mgr,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ GSList *cp_name_list;
+ gchar **list;
+ const char *name = NULL;
+ int count;
+
+ cp_name_list = tcore_server_get_cp_name_list(ctx->server);
+ if (cp_name_list == NULL) {
+ telephony_manager_complete_get_modems(mgr, invocation, &name);
+ return TRUE;
+ }
+
+ count = g_slist_length(cp_name_list);
+ list = g_try_malloc0(sizeof(gchar *) * (count + 1));
+ if (list == NULL) {
+ err("Failed to allocate list");
+ FAIL_RESPONSE(invocation, DEFAULT_MSG_REQ_FAILED);
+
+ /* Freeing the received list of CP names */
+ g_slist_free_full(cp_name_list, g_free);
+
+ return TRUE;
+ }
+
+ count = 0;
+ for ( ; cp_name_list ; cp_name_list = cp_name_list->next) {
+ name = cp_name_list->data;
+ list[count] = g_strdup(name);
+ dbg("list[%d]: %s", count, list[count]);
+ count++;
+ }
+
+ telephony_manager_complete_get_modems(mgr, invocation, (const gchar **)list);
+
+ /* Free memory */
+ for (; count >= 0; count--)
+ g_free(list[count]);
+ g_free(list);
+
+ /* Freeing the received list of CP names */
+ g_slist_free_full(cp_name_list, g_free);
+
+ return TRUE;
+}
+
+static void on_name_lost(GDBusConnection *conn,
+ const gchar *name, gpointer user_data)
+{
+ info("Lost the name '%s' on the Session bus!!!", name);
+}
+
+static void on_name_acquired(GDBusConnection *conn,
+ const gchar *name, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ Storage *strg;
+ int count;
+
+ ctx->name_acquired = TRUE; /* Setting Bus acquried flag after Bus name is acquired */
+
+ info("Acquired the name '%s' on the Session bus", name);
+ strg = tcore_server_find_storage(ctx->server, "vconf");
+
+ count = tcore_storage_get_int(strg, STORAGE_KEY_TELEPHONY_SIM_SLOT_COUNT);
+ if (count < 0) {
+ err("SIM slot count not yet set");
+ } else {
+ if (tcore_storage_get_bool(strg, STORAGE_KEY_TELEPHONY_READY) == FALSE) {
+ gboolean b_set;
+
+ b_set = tcore_storage_set_bool(strg, STORAGE_KEY_TELEPHONY_READY, TRUE);
+ if (b_set == FALSE) {
+ err("Fail to set telephony ready");
+
+ /* Reset STORAGE_KEY_TELEPHONY_SIM_SLOT_COUNT */
+ b_set = tcore_storage_set_int(strg, STORAGE_KEY_TELEPHONY_SIM_SLOT_COUNT, -1);
+ warn("Reset STORAGE_KEY_TELEPHONY_SIM_SLOT_COUNT!!!");
+ } else {
+#ifdef ENABLE_KPI_LOGS
+ TIME_CHECK("Setting VCONFKEY_TELEPHONY_READY to TRUE");
+#else
+ msg("Setting VCONFKEY_TELEPHONY_READY to TRUE");
+#endif
+ }
+ }
+ }
+}
+
+static void on_bus_acquired(GDBusConnection *conn,
+ const gchar *name, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+
+ info("dbus registered");
+
+ /*
+ * Refresh object
+ */
+ __dtapi_refresh_object(ctx);
+
+ /*
+ * Add interface to 'default' object path
+ */
+ ctx->mgr = telephony_manager_skeleton_new();
+
+ /*
+ * Register Manager signal handler(s)
+ */
+ g_signal_connect(ctx->mgr,
+ "handle-get-modems",
+ G_CALLBACK(on_manager_getmodems),
+ ctx); /* user_data */
+
+ /*
+ * Export interface onto Connection (conn) with 'path' (MY_DBUS_PATH)
+ */
+ g_dbus_interface_skeleton_export(G_DBUS_INTERFACE_SKELETON(ctx->mgr),
+ conn, MY_DBUS_PATH, NULL);
+
+ /*
+ * Exports all objects managed by 'manager' on Connection (conn)
+ */
+ g_dbus_object_manager_server_set_connection(ctx->manager, conn);
+
+ dbg("Aquire DBUS - COMPLETE");
+}
+
+static TReturn dtapi_send_response(Communicator *comm, UserRequest *ur,
+ enum tcore_response_command command, unsigned int data_len, const void *data)
{
struct custom_data *ctx = NULL;
struct dbus_request_info *dbus_info;
gboolean ret = FALSE;
- dbg("Response Command = [0x%x], data_len = %d", command, data_len);
-
-
ctx = tcore_communicator_ref_user_data(comm);
if (!ctx) {
- dbg("user_data is NULL");
+ err("user_data is NULL");
return TCORE_RETURN_EINVAL;
}
dbus_info = (struct dbus_request_info *)tcore_user_request_ref_user_info(ur);
if (!dbus_info) {
- dbg("dbus_info is NULL");
+ err("dbus_info is NULL");
return TCORE_RETURN_EINVAL;
}
if (!data) {
- g_dbus_method_invocation_return_error (dbus_info->invocation,
- G_DBUS_ERROR,
- G_DBUS_ERROR_FAILED,
- "Request failed");
+ err("data is NULL");
+ FAIL_RESPONSE(dbus_info->invocation, "Request failed");
+
return TCORE_RETURN_SUCCESS;
}
- switch (command & (TCORE_RESPONSE | 0x0FF00000)) {
- case TRESP_CALL:
- ret = dbus_plugin_call_response(ctx, ur, dbus_info, command, data_len, data);
- break;
+ dbg("cmd[0x%x] len[%d]", command, data_len);
- case TRESP_SS:
- ret = dbus_plugin_ss_response(ctx, ur, dbus_info, command, data_len, data);
- break;
+ switch (command & (TCORE_RESPONSE | 0x0FF00000)) {
+ case TRESP_CALL:
+ ret = dbus_plugin_call_response(ctx, ur, dbus_info, command, data_len, data);
+ break;
- case TRESP_PS:
- break;
+ case TRESP_SS:
+ ret = dbus_plugin_ss_response(ctx, ur, dbus_info, command, data_len, data);
+ break;
- case TRESP_SIM:
- ret = dbus_plugin_sim_response(ctx, ur, dbus_info, command, data_len, data);
- break;
+ case TRESP_PS:
+ warn("Unhandled command (0x%x)", command);
+ break;
- case TRESP_SAP:
- ret = dbus_plugin_sap_response(ctx, ur, dbus_info, command, data_len, data);
- break;
+ case TRESP_SIM:
+ ret = dbus_plugin_sim_response(ctx, ur, dbus_info, command, data_len, data);
+ break;
- case TRESP_PHONEBOOK:
- ret = dbus_plugin_phonebook_response(ctx, ur, dbus_info, command, data_len, data);
- break;
+ case TRESP_SAP:
+ ret = dbus_plugin_sap_response(ctx, ur, dbus_info, command, data_len, data);
+ break;
- case TRESP_MODEM:
- ret = dbus_plugin_modem_response(ctx, ur, dbus_info, command, data_len, data);
- break;
+ case TRESP_PHONEBOOK:
+ ret = dbus_plugin_phonebook_response(ctx, ur, dbus_info, command, data_len, data);
+ break;
- case TRESP_SMS:
- ret = dbus_plugin_sms_response(ctx, ur, dbus_info, command, data_len, data);
- break;
+ case TRESP_MODEM:
+ ret = dbus_plugin_modem_response(ctx, ur, dbus_info, command, data_len, data);
+ break;
- case TRESP_SAT:
- ret = dbus_plugin_sat_response(ctx, ur, dbus_info, command, data_len, data);
- break;
+ case TRESP_SMS:
+ ret = dbus_plugin_sms_response(ctx, ur, dbus_info, command, data_len, data);
+ break;
- case TRESP_CUSTOM:
- ret = dbus_plugin_oem_response(ctx, ur, dbus_info, command, data_len, data);
- break;
+ case TRESP_SAT:
+ ret = dbus_plugin_sat_response(ctx, ur, dbus_info, command, data_len, data);
+ break;
- case TRESP_NETWORK:
- ret = dbus_plugin_network_response(ctx, ur, dbus_info, command, data_len, data);
- break;
+ case TRESP_CUSTOM:
+ ret = dbus_plugin_oem_response(ctx, ur, dbus_info, command, data_len, data);
+ break;
- case TRESP_GPS:
- ret = dbus_plugin_gps_response(ctx, ur, dbus_info, command, data_len, data);
- break;
+ case TRESP_NETWORK:
+ ret = dbus_plugin_network_response(ctx, ur, dbus_info, command, data_len, data);
+ break;
- default:
- warn("unknown command (0x%x)", command);
- break;
+ default:
+ warn("unknown command (0x%x)", command);
+ break;
}
if (ret == TRUE)
return TCORE_RETURN_FAILURE;
}
-static TReturn send_notification(Communicator *comm, CoreObject *source, enum tcore_notification_command command, unsigned int data_len, const void *data)
+static TReturn dtapi_send_notification(Communicator *comm, CoreObject *source,
+ enum tcore_notification_command command, unsigned int data_len, const void *data)
{
struct custom_data *ctx = NULL;
unsigned int noti = 0;
* Module notifications
*/
if (noti == TNOTI_SERVER) {
- dbg("Server (System) Notification");
+ dbg("Server (System) Notification (0x%x)", command);
switch (command) {
case TNOTI_SERVER_ADDED_MODEM_PLUGIN: {
const char *cp_name;
- cp_name = tcore_server_get_cp_name_by_plugin((TcorePlugin*)data);
+ cp_name = tcore_server_get_cp_name_by_plugin((TcorePlugin *)data);
dbg("Modem Plug-in (%s) is added... Exporting interfaces for the modem", cp_name);
- add_modem(ctx, (TcorePlugin*)data);
+
+ __dtapi_add_modem(ctx, (TcorePlugin *)data); /* Add modem */
ret = TRUE;
- break;
}
+ break;
case TNOTI_SERVER_ADDED_MODEM_PLUGIN_COMPLETED: {
Storage *strg;
#endif
}
}
- dbg("Bus acquired...[%s]", (ctx->name_acquired)?"YES":"NO" );
+ dbg("Bus acquired...[%s]", (ctx->name_acquired) ? "YES" : "NO");
}
ret = TRUE;
- break;
}
+ break;
+
+ case TNOTI_SERVER_REMOVED_MODEM_PLUGIN: {
+ TcorePlugin *plugin = tcore_communicator_ref_plugin(comm);
+ TelephonyObjectSkeleton *object;
+ const char *cp_name;
+ char *path;
+
+ dbg("plugin: [%p]", plugin);
+ cp_name = tcore_server_get_cp_name_by_plugin((TcorePlugin *)data);
+ if (cp_name == NULL) {
+ warn("CP name is NULL. cmd:(0x%x)", command);
+ return TCORE_RETURN_FAILURE;
+ }
+
+ path = g_strdup_printf("%s/%s", MY_DBUS_PATH, cp_name);
+
+ /* Look-up Hash table for Object */
+ object = g_hash_table_lookup(ctx->objects, path);
+
+ __dtapi_initialize_properties(source, object);
+
+ g_free(path);
+ }
+ break;
+
+ case TNOTI_SERVER_RUN:
+ dbg("TNOTI_SERVER_RUN");
+ break;
+
+ case TNOTI_SERVER_ADDED_PLUGIN:
+ dbg("TNOTI_SERVER_ADDED_PLUGIN");
+ break;
+
+ case TNOTI_SERVER_ADDED_COMMUNICATOR:
+ dbg("TNOTI_SERVER_ADDED_COMMUNICATOR");
+ break;
+
+ case TNOTI_SERVER_ADDED_HAL:
+ dbg("TNOTI_SERVER_ADDED_HAL");
+ break;
+
+ case TNOTI_SERVER_EXIT: {
+ Storage *strg = NULL;
+
+ dbg("TNOTI_SERVER_EXIT");
+
+ /* Reset STORAGE_KEY_TELEPHONY_READY */
+ strg = tcore_server_find_storage(ctx->server, "vconf");
+ tcore_storage_set_bool(strg, STORAGE_KEY_TELEPHONY_READY, FALSE);
+
+ /*
+ * Exit Telephony daemon
+ */
+ if (TCORE_RETURN_SUCCESS == tcore_server_exit(ctx->server))
+ ret = TRUE;
+ }
+ break;
default:
warn("Unsupported System notification: (0x%x)", command);
- break;
+ break;
}
- }
- else {
+ } else {
TelephonyObjectSkeleton *object;
const char *cp_name;
char *path;
cp_name = tcore_server_get_cp_name_by_plugin(tcore_object_ref_plugin(source));
if (cp_name == NULL) {
- err("CP name is NULL");
+ warn("CP name is NULL. cmd:(0x%x)", command);
return TCORE_RETURN_FAILURE;
}
/* Look-up Hash table for Object */
object = g_hash_table_lookup(ctx->objects, path);
- dbg("[%s]:(cmd[0x%x] data[%p] len[%d] obj[%p])",
- cp_name, command, data, data_len, object);
+ dbg("[%s]:(cmd[0x%x] len[%d])", cp_name, command, data_len);
g_free(path);
if (object == NULL) {
switch (noti) {
case TNOTI_CALL:
ret = dbus_plugin_call_notification(ctx, source, object, command, data_len, data);
- break;
+ break;
case TNOTI_SS:
ret = dbus_plugin_ss_notification(ctx, source, object, command, data_len, data);
- break;
+ break;
- case TNOTI_PS:
- warn("PS Notification (0x%x)... Not handled!!!", noti);
- break;
+ case TNOTI_PS:
+ /* dbg("PS Notification (0x%x)... Not handled!!!", noti); */
+ break;
case TNOTI_SIM:
ret = dbus_plugin_sim_notification(ctx, source, object, command, data_len, data);
- break;
+ break;
case TNOTI_SAP:
ret = dbus_plugin_sap_notification(ctx, source, object, command, data_len, data);
- break;
+ break;
case TNOTI_PHONEBOOK:
ret = dbus_plugin_phonebook_notification(ctx, source, object, command, data_len, data);
- break;
+ break;
case TNOTI_MODEM:
ret = dbus_plugin_modem_notification(ctx, source, object, command, data_len, data);
- break;
+ break;
case TNOTI_SMS:
ret = dbus_plugin_sms_notification(ctx, source, object, command, data_len, data);
- break;
+ break;
case TNOTI_SAT:
ret = dbus_plugin_sat_notification(ctx, source, object, command, data_len, data);
- break;
+ break;
case TNOTI_NETWORK:
ret = dbus_plugin_network_notification(ctx, source, object, command, data_len, data);
- break;
-
- case TNOTI_GPS:
- ret = dbus_plugin_gps_notification(ctx, source, object, command, data_len, data);
- break;
+ break;
default:
- if ((command & (TCORE_NOTIFICATION | 0x0F000000)) == (TNOTI_CUSTOM)) {
- dbg("Custom Notification: [0x%x]", command);
+ if ((command & (TCORE_NOTIFICATION | 0x0F000000)) == TNOTI_CUSTOM)
ret = dbus_plugin_oem_notification(ctx, source, object, command, data_len, data);
- } else {
+ else
warn("Unknown/Unhandled Notification: [0x%x]", command);
- }
- break;
+ break;
}
}
return TCORE_RETURN_FAILURE;
}
-
-static gboolean
-on_manager_getmodems (TelephonyManager *mgr,
- GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- GSList *cp_name_list;
- gchar **list;
- const char *name = NULL;
- int count;
- dbg("Entry");
-
- cp_name_list = tcore_server_get_cp_name_list(ctx->server);
- if (cp_name_list == NULL) {
- telephony_manager_complete_get_modems(mgr, invocation, &name);
- return TRUE;
- }
-
- count = g_slist_length(cp_name_list);
- list = g_try_malloc0(sizeof(gchar *) * (count+1));
- if (list == NULL) {
- err("Memory allocation failed!!");
- telephony_manager_complete_get_modems(mgr, invocation, &name);
- g_slist_free_full(cp_name_list, g_free);
- return TRUE;
- }
-
- count = 0;
- for ( ; cp_name_list ; cp_name_list = cp_name_list->next) {
- name = cp_name_list->data;
- list[count] = g_strdup(name);
- dbg("list[%d]: %s", count, list[count]);
- count++;
- }
-
- telephony_manager_complete_get_modems(mgr, invocation, (const gchar **)list);
-
- /* Free memory */
- for (;count >= 0; count--)
- g_free(list[count]);
-
- g_free(list);
-
- /* Freeing the received list of CP names */
- g_slist_free_full(cp_name_list, g_free);
-
- return TRUE;
-}
-
-static void on_name_lost(GDBusConnection *conn, const gchar *name, gpointer user_data)
-{
- info("Lost the name %s on the session bus\n", name);
-}
-
-static void on_name_acquired(GDBusConnection *conn, const gchar *name, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- Storage *strg;
- gboolean b_set;
- int count;
-
- ctx->name_acquired = TRUE; /* Setting Bus acquried flag after Bus name is acquired */
-
- info("Acquired the name %s on the session bus", name);
- strg = tcore_server_find_storage(ctx->server, "vconf");
-
- count = tcore_storage_get_int(strg, STORAGE_KEY_TELEPHONY_SIM_SLOT_COUNT);
- if (count < 0) {
- err("SIM slot count not yet set");
- } else {
- if (tcore_storage_get_bool(strg, STORAGE_KEY_TELEPHONY_READY) == FALSE) {
- b_set = tcore_storage_set_bool(strg, STORAGE_KEY_TELEPHONY_READY, TRUE);
- if (b_set == FALSE) {
- err("Fail to set telephony ready");
-
- /* Reset STORAGE_KEY_TELEPHONY_SIM_SLOT_COUNT */
- b_set = tcore_storage_set_int(strg, STORAGE_KEY_TELEPHONY_SIM_SLOT_COUNT, -1);
- warn("Reset STORAGE_KEY_TELEPHONY_SIM_SLOT_COUNT!!!");
- } else {
-#ifdef ENABLE_KPI_LOGS
- TIME_CHECK("Setting VCONFKEY_TELEPHONY_READY to TRUE");
-#else
- msg("Setting VCONFKEY_TELEPHONY_READY to TRUE");
-#endif
- }
- }
- }
-}
-
-static void on_bus_acquired(GDBusConnection *conn, const gchar *name, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
-
- info("dbus registered");
-
- refresh_object(ctx);
-
- /* Add interface to default object path */
- ctx->mgr = telephony_manager_skeleton_new();
- g_signal_connect (ctx->mgr,
- "handle-get-modems",
- G_CALLBACK (on_manager_getmodems),
- ctx); /* user_data */
-
- g_dbus_interface_skeleton_export(G_DBUS_INTERFACE_SKELETON(ctx->mgr), conn, MY_DBUS_PATH, NULL);
-
- g_dbus_object_manager_server_set_connection (ctx->manager, conn);
-
- dbg("Aquire DBUS - COMPLETE");
-
-
-}
-
-struct tcore_communitor_operations ops = {
- .send_response = send_response,
- .send_notification = send_notification,
+/*
+ * DBUS communicator operations
+ */
+struct tcore_communicator_operations dbus_ops = {
+ .send_response = dtapi_send_response,
+ .send_notification = dtapi_send_notification,
};
-static gboolean on_load()
-{
- dbg("i'm load!");
-
- return TRUE;
-}
-
-static gboolean on_init(TcorePlugin *p)
+gboolean dtapi_init(TcorePlugin *p)
{
Communicator *comm;
struct custom_data *data;
guint id;
- if (!p)
- return FALSE;
-
- dbg("i'm init!");
+ dbg("Enter");
data = calloc(1, sizeof(struct custom_data));
- if (!data) {
+ if (!data)
return FALSE;
- }
data->plugin = p;
- comm = tcore_communicator_new(p, "dbus", &ops);
+ comm = tcore_communicator_new(p, "dbus", &dbus_ops);
tcore_communicator_link_user_data(comm, data);
data->comm = comm;
dbg("data = %p", data);
- id = g_bus_own_name (G_BUS_TYPE_SYSTEM,
- MY_DBUS_SERVICE,
- G_BUS_NAME_OWNER_FLAGS_REPLACE,
- on_bus_acquired,
- on_name_acquired, on_name_lost,
- data,
- NULL);
+ id = g_bus_own_name(G_BUS_TYPE_SYSTEM,
+ MY_DBUS_SERVICE,
+ G_BUS_NAME_OWNER_FLAGS_REPLACE,
+ on_bus_acquired,
+ on_name_acquired, on_name_lost,
+ data,
+ NULL);
data->owner_id = id;
dbg("owner id=[%d]", data->owner_id);
- data->manager = g_dbus_object_manager_server_new (MY_DBUS_PATH);
- refresh_object(data);
+ data->manager = g_dbus_object_manager_server_new(MY_DBUS_PATH);
+ __dtapi_refresh_object(data);
return TRUE;
}
-static void on_unload(TcorePlugin *p)
+void dtapi_deinit(TcorePlugin *p)
{
struct custom_data *data = 0;
Communicator *comm = 0;
GSList *list = NULL;
struct cached_data *object = NULL;
- if (!p)
- return;
-
- dbg("i'm unload");
+ dbg("Enter");
comm = tcore_server_find_communicator(s, "dbus");
if (!comm)
if (!data)
return;
- if(data->owner_id > 0) {
- g_bus_unown_name(data->owner_id);
- }
-
g_hash_table_destroy(data->objects);
for (list = data->cached_data; list; list = list->next) {
tcore_server_remove_communicator(s, comm);
}
-EXPORT_API struct tcore_plugin_define_desc plugin_define_desc =
-{
- .name = "NEW_DBUS_COMMUNICATOR",
- .priority = TCORE_PLUGIN_PRIORITY_HIGH,
- .version = PLUGIN_VERSION,
- .load = on_load,
- .init = on_init,
- .unload = on_unload
-};
--- /dev/null
+/*
+ * tel-plugin-dbus-tapi
+ *
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Ja-young Gu <jygu@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <glib.h>
+
+#include <tcore.h>
+#include <server.h>
+#include <user_request.h>
+#include <co_modem.h>
+
+#include "generated-code.h"
+#include "dtapi_common.h"
+
+static gboolean on_modem_set_power(TelephonyModem *modem,
+ GDBusMethodInvocation *invocation, gint mode, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ enum tcore_request_command command;
+
+ if (!check_access_control(invocation, AC_MODEM, "x"))
+ return TRUE;
+
+ switch (mode) {
+ case MODEM_STATE_ONLINE:
+ command = TREQ_MODEM_POWER_ON;
+ break;
+
+ case MODEM_STATE_OFFLINE:
+ command = TREQ_MODEM_POWER_OFF;
+ break;
+
+ case MODEM_STATE_RESET:
+ command = TREQ_MODEM_POWER_RESET;
+ break;
+
+ case MODEM_STATE_LOW:
+ command = TREQ_MODEM_POWER_LOW;
+ break;
+
+ default:
+ FAIL_RESPONSE(invocation, DEFAULT_MSG_REQ_FAILED);
+ return TRUE;
+ }
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, modem, invocation,
+ command,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_modem_set_flight_mode(TelephonyModem *modem,
+ GDBusMethodInvocation *invocation, gboolean enable, gpointer user_data)
+{
+ struct treq_modem_set_flightmode req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_MODEM, "w"))
+ return TRUE;
+
+ req.enable = enable;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, modem, invocation,
+ TREQ_MODEM_SET_FLIGHTMODE,
+ &req, sizeof(struct treq_modem_set_flightmode));
+
+ return TRUE;
+}
+
+static gboolean on_modem_get_flight_mode(TelephonyModem *modem,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_MODEM, "r"))
+ return TRUE;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, modem, invocation,
+ TREQ_MODEM_GET_FLIGHTMODE,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_modem_get_version(TelephonyModem *modem,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_MODEM, "r"))
+ return TRUE;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, modem, invocation,
+ TREQ_MODEM_GET_VERSION,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_modem_get_serial_number(TelephonyModem *modem,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_MODEM, "r"))
+ return TRUE;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, modem, invocation,
+ TREQ_MODEM_GET_SN,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_modem_get_imei(TelephonyModem *modem,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_MODEM, "r"))
+ return TRUE;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, modem, invocation,
+ TREQ_MODEM_GET_IMEI,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_modem_set_dun_pin_ctrl(TelephonyModem *modem,
+ GDBusMethodInvocation *invocation,
+ gint signal, gboolean status, gpointer user_data)
+{
+ struct treq_modem_set_dun_pin_control req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_MODEM, "x"))
+ return TRUE;
+
+ req.signal = signal;
+ req.status = status;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, modem, invocation,
+ TREQ_MODEM_GET_VERSION,
+ &req, sizeof(struct treq_modem_set_dun_pin_control));
+
+ return TRUE;
+}
+
+static gboolean on_modem_get_device_info(TelephonyModem *modem,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_MODEM, "r"))
+ return TRUE;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, modem, invocation,
+ TREQ_MODEM_GET_DEVICE_INFO,
+ NULL, 0);
+
+ return TRUE;
+}
+
+gboolean dbus_plugin_setup_modem_interface(TelephonyObjectSkeleton *object,
+ struct custom_data *ctx)
+{
+ TelephonyModem *modem;
+
+ modem = telephony_modem_skeleton_new();
+ telephony_object_skeleton_set_modem(object, modem);
+ g_object_unref(modem);
+
+ dbg("modem: [%p]", modem);
+
+ /*
+ * Register signal handlers for Modem interface
+ */
+ g_signal_connect(modem,
+ "handle-set-power",
+ G_CALLBACK(on_modem_set_power), ctx);
+
+ g_signal_connect(modem,
+ "handle-set-flight-mode",
+ G_CALLBACK(on_modem_set_flight_mode), ctx);
+
+ g_signal_connect(modem,
+ "handle-get-flight-mode",
+ G_CALLBACK(on_modem_get_flight_mode), ctx);
+
+ g_signal_connect(modem,
+ "handle-get-version",
+ G_CALLBACK(on_modem_get_version), ctx);
+
+ g_signal_connect(modem,
+ "handle-get-serial-number",
+ G_CALLBACK(on_modem_get_serial_number), ctx);
+
+ g_signal_connect(modem,
+ "handle-get-imei",
+ G_CALLBACK(on_modem_get_imei), ctx);
+
+ g_signal_connect(modem,
+ "handle-set-dun-pin-ctrl",
+ G_CALLBACK(on_modem_set_dun_pin_ctrl), ctx);
+
+ g_signal_connect(modem,
+ "handle-get-device-info",
+ G_CALLBACK(on_modem_get_device_info), ctx);
+
+ /*
+ * Initialize 'properties'
+ */
+ telephony_modem_set_power(modem, MODEM_STATE_UNKNOWN);
+
+ return TRUE;
+}
+
+gboolean dbus_plugin_modem_response(struct custom_data *ctx,
+ UserRequest *ur, struct dbus_request_info *dbus_info,
+ enum tcore_response_command command, unsigned int data_len, const void *data)
+{
+ char *cpname = dbus_info ? GET_CP_NAME(dbus_info->invocation) : "";
+
+ switch (command) {
+ case TRESP_MODEM_SET_FLIGHTMODE: {
+ const struct tresp_modem_set_flightmode *resp_set_flight_mode = data;
+ int set_flight_mode = 3; /* TAPI_POWER_FLIGHT_MODE_RESP_FAIL */
+
+ if (resp_set_flight_mode->result == TCORE_RETURN_SUCCESS) {
+ const struct treq_modem_set_flightmode *treq_data;
+ treq_data = tcore_user_request_ref_data(ur, NULL);
+ if (treq_data == NULL) {
+ warn("No Request data!!!");
+ set_flight_mode = 3; /* TAPI_POWER_FLIGHT_MODE_RESP_FAIL */
+ } else if (treq_data->enable == TRUE) {
+ set_flight_mode = 1; /* TAPI_POWER_FLIGHT_MODE_RESP_ON */
+ } else {
+ set_flight_mode = 2; /* TAPI_POWER_FLIGHT_MODE_RESP_OFF */
+ }
+ }
+
+ dbg("[%s] SET_FLIGHTMODE - [%s] [%s]", cpname,
+ (resp_set_flight_mode->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"),
+ (set_flight_mode == 1 ? "ON" :
+ (set_flight_mode == 2 ? "OFF" : "Request FAIL")));
+
+ telephony_modem_complete_set_flight_mode(dbus_info->interface_object,
+ dbus_info->invocation, set_flight_mode);
+ }
+ break;
+
+ case TRESP_MODEM_GET_FLIGHTMODE: {
+ const struct tresp_modem_get_flightmode *resp_get_flight_mode = data;
+
+ dbg("[%s] GET_FLIGHTMODE - [%s]", cpname,
+ (resp_get_flight_mode->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"));
+
+ telephony_modem_complete_get_flight_mode(dbus_info->interface_object,
+ dbus_info->invocation,
+ resp_get_flight_mode->enable, resp_get_flight_mode->result);
+ }
+ break;
+
+ case TRESP_MODEM_POWER_ON: {
+ const struct tresp_modem_power_on *resp_modem_power_on = data;
+ int result = 0;
+
+ dbg("[%s] POWER_ON - [%s]", cpname,
+ (resp_modem_power_on->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"));
+
+ /* TBD: value should be defined in TAPI */
+ if (resp_modem_power_on->result == TCORE_RETURN_EALREADY)
+ result = 1;
+ else if (resp_modem_power_on->result == TCORE_RETURN_OPERATION_ABORTED)
+ result = 2;
+
+ telephony_modem_complete_set_power(dbus_info->interface_object,
+ dbus_info->invocation, result);
+ }
+ break;
+
+ case TRESP_MODEM_POWER_OFF: {
+ dbg("[%s] POWER_OFF", cpname);
+
+ telephony_modem_complete_set_power(dbus_info->interface_object,
+ dbus_info->invocation, 0);
+ }
+ break;
+
+ case TRESP_MODEM_POWER_RESET: {
+ dbg("[%s] POWER_RESET", cpname);
+
+ telephony_modem_complete_set_power(dbus_info->interface_object,
+ dbus_info->invocation, 0);
+ }
+ break;
+
+ case TRESP_MODEM_POWER_LOW: {
+ dbg("[%s] POWER_LOW", cpname);
+
+ telephony_modem_complete_set_power(dbus_info->interface_object,
+ dbus_info->invocation, 0);
+ }
+ break;
+
+ case TRESP_MODEM_GET_IMEI: {
+ const struct tresp_modem_get_imei *resp_get_imei = data;
+
+ dbg("[%s] GET_IMEI - [%s]", cpname,
+ (resp_get_imei->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"));
+
+ telephony_modem_complete_get_imei(dbus_info->interface_object,
+ dbus_info->invocation,
+ resp_get_imei->result, resp_get_imei->imei);
+ }
+ break;
+
+ case TRESP_MODEM_GET_SN: {
+ const struct tresp_modem_get_sn *resp_get_sn = data;
+
+ dbg("[%s] GET_SN - [%s]", cpname,
+ (resp_get_sn->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"));
+
+ telephony_modem_complete_get_serial_number(dbus_info->interface_object,
+ dbus_info->invocation, resp_get_sn->result,
+ resp_get_sn->sn, resp_get_sn->meid,
+ resp_get_sn->imei, resp_get_sn->imeisv);
+ }
+ break;
+
+ case TRESP_MODEM_GET_VERSION: {
+ const struct tresp_modem_get_version *resp_get_version = data;
+
+ dbg("[%s] GET_VERSION - [%s]", cpname,
+ (resp_get_version->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"));
+
+ telephony_modem_complete_get_version(dbus_info->interface_object,
+ dbus_info->invocation, resp_get_version->result,
+ resp_get_version->software, resp_get_version->hardware,
+ resp_get_version->calibration, resp_get_version->product_code,
+ resp_get_version->prl_version, resp_get_version->eri_version);
+ }
+ break;
+
+ case TRESP_MODEM_SET_DUN_PIN_CONTROL: {
+ const struct tresp_modem_set_dun_pin_control *resp_dun_pin_ctrl = data;
+
+ dbg("[%s] SET_DUN_PIN_CONTROL - [%s]", cpname,
+ (resp_dun_pin_ctrl->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"));
+
+ telephony_modem_complete_set_dun_pin_ctrl(dbus_info->interface_object,
+ dbus_info->invocation, resp_dun_pin_ctrl->result);
+ }
+ break;
+
+ case TRESP_MODEM_GET_DEVICE_INFO: {
+ const struct tresp_modem_get_device_info *resp_get_device_info = data;
+
+ dbg("[%s] TGET_DEVICE_INFO - Vendor[%s] Device[%s]", cpname,
+ resp_get_device_info->vendor_name,
+ resp_get_device_info->device_name);
+
+ telephony_modem_complete_get_device_info(dbus_info->interface_object,
+ dbus_info->invocation, resp_get_device_info->result,
+ resp_get_device_info->vendor_name, resp_get_device_info->device_name);
+ }
+ break;
+
+ default:
+ err("Unhandled/Unknown Response: [0x%x]", command);
+ break;
+ }
+
+ return TRUE;
+}
+
+gboolean dbus_plugin_modem_notification(struct custom_data *ctx,
+ CoreObject *source, TelephonyObjectSkeleton *object,
+ enum tcore_notification_command command, unsigned int data_len, const void *data)
+{
+ TelephonyModem *modem;
+ const char *cp_name;
+ cp_name = tcore_server_get_cp_name_by_plugin(tcore_object_ref_plugin(source));
+
+ if (!object) {
+ dbg("object is NULL");
+ return FALSE;
+ }
+ modem = telephony_object_peek_modem(TELEPHONY_OBJECT(object));
+ if (modem == NULL) {
+ err("modem object is NULL!!!");
+ return FALSE;
+ }
+
+ switch (command) {
+ case TNOTI_MODEM_POWER: {
+ const struct tnoti_modem_power *info = data;
+ enum modem_state state = info->state;
+
+ dbg("[%s] MODEM_POWER: [%s]", cp_name,
+ (state == MODEM_STATE_UNKNOWN ? "UNKNOWN" :
+ (state == MODEM_STATE_ONLINE ? "ONLINE" :
+ (state == MODEM_STATE_OFFLINE ? "OFFLINE" :
+ (state == MODEM_STATE_RESET ? "RESET" :
+ (state == MODEM_STATE_LOW ? "LOW" :
+ "INTERNAL STATE"))))));
+ if (state > MODEM_STATE_MAX)
+ break;
+
+ telephony_modem_emit_power(modem, state);
+ telephony_modem_set_power(modem, state);
+ }
+ break;
+
+ case TNOTI_MODEM_DUN_PIN_CONTROL: {
+ const struct tnoti_modem_dun_pin_control *pin = data;
+
+ dbg("[%s] MODEM_DUN_PIN_CONTROL (Signal: [0x%2x] Status: [0x%2x])",
+ cp_name, pin->signal, pin->status);
+
+ telephony_modem_emit_dun_pin_ctrl(modem, pin->signal, pin->status);
+ }
+ break;
+
+ case TNOTI_MODEM_DUN_EXTERNAL_CALL: {
+ dbg("[%s] MODEM_DUN_EXTERNAL_CALL", cp_name);
+
+ telephony_modem_emit_dun_external_call(modem, TRUE);
+ }
+ break;
+
+ case TNOTI_MODEM_DONGLE_STATUS:
+ dbg("[%s] MODEM_DONGLE_STATUS (state:[%d])", cp_name, *(int *)data);
+ telephony_modem_set_dongle_status(modem, *(int *)data);
+ break;
+
+ case TNOTI_MODEM_DONGLE_LOGIN:
+ dbg("[%s] MODEM_DONGLE_LOGIN (login state:[%d])", cp_name, *(int *)data);
+ telephony_modem_set_dongle_login(modem, *(int *)data);
+ break;
+
+ default:
+ err("Unhandled/Unknown Notification: [0x%x]", command);
+ break;
+ }
+
+ return TRUE;
+}
+
--- /dev/null
+/*
+ * tel-plugin-dbus-tapi
+ *
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Ja-young Gu <jygu@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <glib.h>
+
+#include <tcore.h>
+#include <server.h>
+#include <plugin.h>
+#include <co_network.h>
+
+#include "generated-code.h"
+#include "dtapi_common.h"
+
+/*
+ * Application used properties
+ */
+#define NET_PROP_NONE 0x0000
+#define NET_PROP_SVC_TYPE 0x0001
+#define NET_PROP_ROAM 0x0002
+#define NET_PROP_PLMN 0x0004
+#define NET_PROP_NAME_OPTION 0x0100
+#define NET_PROP_SPN 0x0200
+#define NET_PROP_NWNAME 0x0400
+#define NET_PROP_EMIT 0x0FFF
+
+/*
+ * Extra properties
+ */
+#define NET_PROP_CS 0x1000
+#define NET_PROP_PS 0x2000
+#define NET_PROP_ACT 0x4000
+#define NET_PROP_ALL 0xFFFF
+
+typedef struct {
+ int type;
+ int svc_type;
+ int ps_type;
+ gboolean roaming;
+ int act;
+ int cs;
+ int ps;
+ int name_option;
+ char *plmn;
+ char *spn;
+ char *nwname;
+} NetworkPropertyInfo;
+
+static int __convert_act_to_systemtype(enum telephony_network_access_technology act)
+{
+ switch (act) {
+ case NETWORK_ACT_UNKNOWN:
+ return 0;
+
+ case NETWORK_ACT_GSM:
+ return 1;
+
+ case NETWORK_ACT_GPRS:
+ return 2;
+
+ case NETWORK_ACT_EGPRS:
+ return 3;
+
+ case NETWORK_ACT_UMTS:
+ return 5;
+
+ case NETWORK_ACT_GSM_UTRAN:
+ return 6;
+
+ case NETWORK_ACT_IS95A:
+ return 8;
+
+ case NETWORK_ACT_IS95B:
+ return 9;
+
+ case NETWORK_ACT_CDMA_1X:
+ return 10;
+
+ case NETWORK_ACT_EVDO_REV0:
+ return 11;
+
+ case NETWORK_ACT_CDMA_1X_EVDO_REV0:
+ return 12;
+
+ case NETWORK_ACT_EVDO_REVA:
+ return 13;
+
+ case NETWORK_ACT_CDMA_1X_EVDO_REVA:
+ return 14;
+
+ case NETWORK_ACT_EVDO_REVB:
+ return 15;
+
+ case NETWORK_ACT_CDMA_1X_EVDO_REVB:
+ return 16;
+
+ case NETWORK_ACT_EVDV:
+ return 17;
+
+ case NETWORK_ACT_EHRPD:
+ return 18;
+
+ case NETWORK_ACT_LTE:
+ return 19;
+
+ default:
+ break;
+ }
+
+ return 0;
+}
+
+static int __convert_name_priority_to_option(enum tcore_network_name_priority priority)
+{
+ switch (priority) {
+ case TCORE_NETWORK_NAME_PRIORITY_SPN:
+ return 1; /* NETWORK_NAME_OPTION_SPN */
+
+ case TCORE_NETWORK_NAME_PRIORITY_NETWORK:
+ return 2; /* NETWORK_NAME_OPTION_OPERATOR */
+
+ case TCORE_NETWORK_NAME_PRIORITY_ANY:
+ return 3; /* NETWORK_NAME_OPTION_ANY */
+
+ default:
+ break;
+ }
+
+ return 0; /* NETWORK_NAME_OPTION_NONE */
+}
+
+static void __get_current_network_status(CoreObject *o,
+ NetworkPropertyInfo *current, int req_type)
+{
+ if (!o || !current)
+ return;
+
+ if (req_type & NET_PROP_SVC_TYPE) {
+ enum telephony_network_service_type svc_type;
+
+ tcore_network_get_service_type(o, &svc_type);
+ current->svc_type = svc_type;
+ }
+
+ if (req_type & NET_PROP_ROAM)
+ current->roaming = tcore_network_get_roaming_state(o);
+
+ if (req_type & NET_PROP_PLMN)
+ current->plmn = tcore_network_get_plmn(o);
+
+ if (req_type & NET_PROP_NAME_OPTION) {
+ enum tcore_network_name_priority priority = TCORE_NETWORK_NAME_PRIORITY_UNKNOWN;
+
+ tcore_network_get_network_name_priority(o, &priority);
+ current->name_option = __convert_name_priority_to_option(priority);
+ }
+
+ if (req_type & NET_PROP_SPN)
+ current->spn = tcore_network_get_network_name(o, TCORE_NETWORK_NAME_TYPE_SPN);
+
+ if (req_type & NET_PROP_NWNAME) {
+ char *nwname = tcore_network_get_network_name(o, TCORE_NETWORK_NAME_TYPE_FULL);
+
+ if (!nwname || strlen(nwname) == 0)
+ nwname = tcore_network_get_network_name(o, TCORE_NETWORK_NAME_TYPE_SHORT);
+ current->nwname = nwname;
+ }
+
+ if (req_type & NET_PROP_CS) {
+ enum telephony_network_service_domain_status cs;
+ tcore_network_get_service_status(o, TCORE_NETWORK_SERVICE_DOMAIN_TYPE_CIRCUIT, &cs);
+
+ current->cs = cs;
+ }
+
+ if (req_type & NET_PROP_PS) {
+ enum telephony_network_service_domain_status ps;
+
+ tcore_network_get_service_status(o, TCORE_NETWORK_SERVICE_DOMAIN_TYPE_PACKET, &ps);
+ current->ps = ps;
+ }
+
+ if (req_type & NET_PROP_ACT) {
+ enum telephony_network_access_technology act = NETWORK_ACT_UNKNOWN;
+
+ tcore_network_get_access_technology(o, &act);
+ current->act = __convert_act_to_systemtype(act);
+ }
+}
+
+static int __check_property_change(TelephonyNetwork *network, CoreObject *o,
+ NetworkPropertyInfo *current, int req_type)
+{
+ int changed_type = NET_PROP_NONE;
+
+ if (!current || !o)
+ return NET_PROP_NONE;
+
+ __get_current_network_status(o, current, req_type);
+
+ if (req_type & NET_PROP_SVC_TYPE)
+ if (telephony_network_get_service_type(network) != current->svc_type)
+ changed_type |= NET_PROP_SVC_TYPE;
+
+ if (req_type & NET_PROP_ROAM)
+ if (telephony_network_get_roaming_status(network) != current->roaming)
+ changed_type |= NET_PROP_ROAM;
+
+ if (req_type & NET_PROP_PLMN) {
+ if (current->plmn) {
+ const gchar *prev_plmn = telephony_network_get_plmn(network);
+
+ if (!prev_plmn || strcmp(prev_plmn, current->plmn) != 0)
+ changed_type |= NET_PROP_PLMN;
+ }
+ }
+
+ if (req_type & NET_PROP_NAME_OPTION)
+ if (telephony_network_get_name_option(network) != current->name_option)
+ changed_type |= NET_PROP_NAME_OPTION;
+
+ if (req_type & NET_PROP_SPN) {
+ if (current->spn) {
+ const gchar *prev_spn = telephony_network_get_spn_name(network);
+
+ if (!prev_spn || strcmp(prev_spn, current->spn) != 0)
+ changed_type |= NET_PROP_SPN;
+ }
+ }
+
+ if (req_type & NET_PROP_NWNAME) {
+ if (current->nwname) {
+ const gchar *prev_nwname = telephony_network_get_network_name(network);
+
+ if (!prev_nwname || strcmp(prev_nwname, current->nwname) != 0)
+ changed_type |= NET_PROP_NWNAME;
+ }
+ }
+
+ if (req_type & NET_PROP_CS)
+ if (telephony_network_get_circuit_status(network) != current->cs)
+ changed_type |= NET_PROP_CS;
+
+ if (req_type & NET_PROP_PS)
+ if (telephony_network_get_packet_status(network) != current->ps)
+ changed_type |= NET_PROP_PS;
+
+ if (req_type & NET_PROP_ACT)
+ if (telephony_network_get_access_technology(network) != current->act)
+ changed_type |= NET_PROP_ACT;
+
+ return changed_type;
+}
+
+static void __update_network_properties(TelephonyNetwork *network,
+ const char *cp_name, NetworkPropertyInfo *current, int update_type)
+{
+ if (!current)
+ return;
+
+ if (update_type & NET_PROP_SVC_TYPE) {
+ telephony_network_set_service_type(network, current->svc_type);
+
+ if (current->svc_type != NETWORK_SERVICE_TYPE_3G)
+ telephony_network_set_ps_type(network, TELEPHONY_HSDPA_OFF);
+ }
+
+ if (update_type & NET_PROP_ROAM)
+ telephony_network_set_roaming_status(network, current->roaming);
+
+ if (update_type & NET_PROP_PLMN)
+ telephony_network_set_plmn(network, current->plmn);
+
+ if (update_type & NET_PROP_NAME_OPTION)
+ telephony_network_set_name_option(network, current->name_option);
+
+ if (update_type & NET_PROP_SPN)
+ telephony_network_set_spn_name(network, current->spn);
+
+ if (update_type & NET_PROP_NWNAME)
+ telephony_network_set_network_name(network, current->nwname);
+
+ if (update_type & NET_PROP_CS)
+ telephony_network_set_circuit_status(network, current->cs);
+
+ if (update_type & NET_PROP_PS)
+ telephony_network_set_packet_status(network, current->ps);
+
+ if (update_type & NET_PROP_ACT)
+ telephony_network_set_access_technology(network, current->act);
+}
+
+static int __add_default_property_type(TelephonyNetwork *network, CoreObject *o, int req_type)
+{
+ /*
+ * If SVC_TYPE was changed,
+ * other properties (ACT, OPTION, SPN, NWNAME) may also be changed together
+ */
+ if (req_type & NET_PROP_SVC_TYPE) {
+ NetworkPropertyInfo current = {0, -1, -1, 0, -1, -1, -1, -1, NULL, NULL, NULL};
+
+ if (__check_property_change(network, o, ¤t, NET_PROP_SVC_TYPE)) {
+ /*
+ * If SVC_TYPE was really changed,
+ * we should add others to default checking value
+ */
+ req_type |= (NET_PROP_ACT | NET_PROP_NAME_OPTION | NET_PROP_SPN | NET_PROP_NWNAME);
+ }
+ }
+
+ /*
+ * If PLMN was changed,
+ * other properties (ROAM,OPTION,SPN,NWNAME) may also be changed together
+ */
+ if (req_type & NET_PROP_PLMN) {
+ NetworkPropertyInfo current = {0, -1, -1, 0, -1, -1, -1, -1, NULL, NULL, NULL};
+
+ if (__check_property_change(network, o, ¤t, NET_PROP_PLMN)) {
+ /*
+ * If PLMN was really changed,
+ * we should add anothers to default checking value
+ */
+ req_type |= (NET_PROP_ROAM | NET_PROP_NAME_OPTION | NET_PROP_SPN | NET_PROP_NWNAME);
+ }
+ g_free(current.plmn);
+ }
+
+ return req_type;
+}
+
+static void __check_network_properties(TelephonyNetwork *network, CoreObject *o,
+ const char *cp_name, int req_type)
+{
+ int changed_type = NET_PROP_NONE;
+ int emit_type = NET_PROP_NONE;
+ NetworkPropertyInfo current = {0, -1, -1, 0, -1, -1, -1, -1, NULL, NULL, NULL};
+
+ req_type = __add_default_property_type(network, o, req_type);
+ changed_type = __check_property_change(network, o, ¤t, req_type);
+
+ if (changed_type)
+ __update_network_properties(network, cp_name, ¤t, changed_type);
+
+ emit_type = (changed_type & NET_PROP_EMIT);
+ if (emit_type) {
+ info("[%s] PROPTYPE: [%04x] svc: [%d] roam: [%s] plmn: [%s] prio: [%d] spn: [%s] nwname: [%s]",
+ cp_name, emit_type, current.svc_type,
+ (current.roaming ? "YES" : "NO"), current.plmn,
+ current.name_option, current.spn, current.nwname);
+
+ telephony_network_emit_property_info(network, emit_type,
+ current.svc_type, current.roaming, current.name_option,
+ current.plmn, current.spn, current.nwname);
+ }
+
+ g_free(current.plmn);
+ g_free(current.spn);
+ g_free(current.nwname);
+}
+
+static enum tcore_hook_return on_hook_ps_protocol_status(Server *s,
+ CoreObject *source, enum tcore_notification_command command,
+ unsigned int data_len, void *data, void *user_data)
+{
+ const struct tnoti_ps_protocol_status *protocol_status = data;
+
+ TelephonyObjectSkeleton *object;
+ TelephonyNetwork *network = NULL;
+ struct custom_data *ctx = user_data;
+ const char *cp_name;
+ char *path;
+
+ enum telephony_ps_protocol_status ps_protocol_status = TELEPHONY_HSDPA_OFF;
+
+ cp_name = tcore_server_get_cp_name_by_plugin(tcore_object_ref_plugin(source));
+ if (cp_name == NULL) {
+ err("CP name is NULL");
+ return TCORE_HOOK_RETURN_CONTINUE;
+ }
+
+ info("[%s] PS_PROTOCOL_STATUS - Status: [%d]", cp_name, protocol_status->status);
+
+ path = g_strdup_printf("%s/%s", MY_DBUS_PATH, cp_name);
+
+ /* Look-up Hash table for Object */
+ object = g_hash_table_lookup(ctx->objects, path);
+ g_free(path);
+ if (object == NULL) {
+ err("Object is NOT defined!!!");
+ return TCORE_HOOK_RETURN_CONTINUE;
+ }
+
+ network = telephony_object_peek_network(TELEPHONY_OBJECT(object));
+ if (network == NULL) {
+ err("Network object is NULL!!!");
+ return TCORE_HOOK_RETURN_CONTINUE;
+ }
+
+ /*
+ * Do not check service_type.
+ * In case of +CGREG is invoked before +CREG(Z1 device),
+ * ps_type is not set because service_type is unknown yet.
+ *
+ if (telephony_network_get_service_type (network) < NETWORK_SERVICE_TYPE_2G) {
+ telephony_network_set_ps_type(network, TELEPHONY_HSDPA_OFF);
+ return TCORE_HOOK_RETURN_CONTINUE;
+ }
+ */
+
+ switch (protocol_status->status) {
+ case TELEPHONY_HSDPA_OFF:
+ ps_protocol_status = TELEPHONY_HSDPA_OFF;
+ break;
+
+ case TELEPHONY_HSDPA_ON:
+ ps_protocol_status = TELEPHONY_HSDPA_ON;
+ break;
+
+ case TELEPHONY_HSUPA_ON:
+ ps_protocol_status = TELEPHONY_HSUPA_ON;
+ break;
+
+ case TELEPHONY_HSPA_ON:
+ ps_protocol_status = TELEPHONY_HSPA_ON;
+ break;
+
+ case TELEPHONY_HSPAP_ON:
+ ps_protocol_status = TELEPHONY_HSPAP_ON;
+ break;
+
+ default:
+ err("Unhandled protocol status!");
+ break;
+ }
+
+ telephony_network_set_ps_type(network, ps_protocol_status);
+
+ return TCORE_HOOK_RETURN_CONTINUE;
+}
+
+static gboolean on_network_search(TelephonyNetwork *network,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_NETWORK, "x"))
+ return TRUE;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, network, invocation,
+ TREQ_NETWORK_SEARCH,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_network_search_cancel(TelephonyNetwork *network,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_NETWORK, "x"))
+ return TRUE;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, network, invocation,
+ TREQ_NETWORK_SET_CANCEL_MANUAL_SEARCH,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_network_get_selection_mode(TelephonyNetwork *network,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_NETWORK, "r"))
+ return TRUE;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, network, invocation,
+ TREQ_NETWORK_GET_PLMN_SELECTION_MODE,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_network_set_selection_mode(TelephonyNetwork *network,
+ GDBusMethodInvocation *invocation,
+ gint mode, const gchar *plmn, gint act, gpointer user_data)
+{
+ struct treq_network_set_plmn_selection_mode req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_NETWORK, "w"))
+ return TRUE;
+
+ memset(&req, 0x0, sizeof(struct treq_network_set_plmn_selection_mode));
+
+ if (mode == 0) { /* Automatic */
+ req.mode = NETWORK_SELECT_MODE_AUTOMATIC;
+ } else if (mode == 1) { /* Manual */
+ req.mode = NETWORK_SELECT_MODE_MANUAL;
+ snprintf(req.plmn, 7, "%s", plmn);
+ req.act = act;
+ } else {
+ FAIL_RESPONSE(invocation, DEFAULT_MSG_REQ_FAILED);
+ return TRUE;
+ }
+ dbg("Mode: [%d] PLMN: [%s] AcT: [%d]", req.mode, req.plmn, req.act);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, network, invocation,
+ TREQ_NETWORK_SET_PLMN_SELECTION_MODE,
+ &req, sizeof(struct treq_network_set_plmn_selection_mode));
+
+ return TRUE;
+}
+
+
+static gboolean on_network_set_service_domain(TelephonyNetwork *network,
+ GDBusMethodInvocation *invocation, gint domain, gpointer user_data)
+{
+ struct treq_network_set_service_domain req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_NETWORK, "w"))
+ return TRUE;
+
+ req.domain = domain;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, network, invocation,
+ TREQ_NETWORK_SET_SERVICE_DOMAIN,
+ &req, sizeof(struct treq_network_set_service_domain));
+
+ return TRUE;
+}
+
+static gboolean on_network_get_service_domain(TelephonyNetwork *network,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_NETWORK, "r"))
+ return TRUE;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, network, invocation,
+ TREQ_NETWORK_GET_SERVICE_DOMAIN,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_network_set_band(TelephonyNetwork *network,
+ GDBusMethodInvocation *invocation,
+ gint band, gint mode, gpointer user_data)
+{
+ struct treq_network_set_band req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_NETWORK, "w"))
+ return TRUE;
+
+ req.mode = mode;
+ req.band = band;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, network, invocation,
+ TREQ_NETWORK_SET_BAND,
+ &req, sizeof(struct treq_network_set_band));
+
+ return TRUE;
+}
+
+static gboolean on_network_get_band(TelephonyNetwork *network,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_NETWORK, "r"))
+ return TRUE;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, network, invocation,
+ TREQ_NETWORK_GET_BAND,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_network_set_mode(TelephonyNetwork *network,
+ GDBusMethodInvocation *invocation, gint mode, gpointer user_data)
+{
+ struct treq_network_set_mode req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_NETWORK, "w"))
+ return TRUE;
+
+ req.mode = mode;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, network, invocation,
+ TREQ_NETWORK_SET_MODE,
+ &req, sizeof(struct treq_network_set_mode));
+
+ return TRUE;
+}
+
+static gboolean on_network_get_mode(TelephonyNetwork *network,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_NETWORK, "r"))
+ return TRUE;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, network, invocation,
+ TREQ_NETWORK_GET_MODE,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_network_set_preferred_plmn(TelephonyNetwork *network,
+ GDBusMethodInvocation *invocation,
+ gint mode, gint ef_index, gint act, const gchar *plmn, gpointer user_data)
+{
+ struct treq_network_set_preferred_plmn req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_NETWORK, "w"))
+ return TRUE;
+
+ req.operation = mode;
+ req.ef_index = ef_index;
+ req.act = act;
+
+ memcpy(req.plmn, plmn, 6);
+
+ if (strlen(plmn) <= 5)
+ req.plmn[5] = '#';
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, network, invocation,
+ TREQ_NETWORK_SET_PREFERRED_PLMN,
+ &req, sizeof(struct treq_network_set_preferred_plmn));
+
+ return TRUE;
+}
+
+static gboolean on_network_get_preferred_plmn(TelephonyNetwork *network,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_NETWORK, "r"))
+ return TRUE;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, network, invocation,
+ TREQ_NETWORK_GET_PREFERRED_PLMN,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_network_get_serving_network(TelephonyNetwork *network,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_NETWORK, "r"))
+ return TRUE;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, network, invocation,
+ TREQ_NETWORK_GET_SERVING_NETWORK,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_network_get_neighboring_cell_info(TelephonyNetwork *network,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_NETWORK, "r"))
+ return TRUE;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, network, invocation,
+ TREQ_NETWORK_GET_NEIGHBORING_CELL_INFO,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_network_set_default_data_subscription(TelephonyNetwork *network,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_NETWORK, "w"))
+ return TRUE;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, network, invocation,
+ TREQ_NETWORK_SET_DEFAULT_DATA_SUBSCRIPTION,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_network_get_default_data_subscription(TelephonyNetwork *network,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_NETWORK, "r"))
+ return TRUE;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, network, invocation,
+ TREQ_NETWORK_GET_DEFAULT_DATA_SUBSCRIPTION,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_network_set_default_subs(TelephonyNetwork *network,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_NETWORK, "w"))
+ return TRUE;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, network, invocation,
+ TREQ_NETWORK_SET_DEFAULT_SUBSCRIPTION,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_network_get_default_subs(TelephonyNetwork *network,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_NETWORK, "r"))
+ return TRUE;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, network, invocation,
+ TREQ_NETWORK_GET_DEFAULT_SUBSCRIPTION,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_network_set_emergency_callback_mode(TelephonyNetwork *network,
+ GDBusMethodInvocation *invocation, gint mode, gpointer user_data)
+{
+ struct treq_network_set_emergency_callback_mode req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_NETWORK, "w"))
+ return TRUE;
+
+ req.mode = mode;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, network, invocation,
+ TREQ_NETWORK_SET_EMERGENCY_CALLBACK_MODE,
+ &req, sizeof(struct treq_network_set_emergency_callback_mode));
+
+ return TRUE;
+}
+
+static gboolean on_network_set_roaming_preference(TelephonyNetwork *network,
+ GDBusMethodInvocation *invocation, gint roam_pref, gpointer user_data)
+{
+ struct treq_network_set_roaming_preference req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_NETWORK, "w"))
+ return TRUE;
+
+ req.roam_pref = roam_pref;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, network, invocation,
+ TREQ_NETWORK_SET_ROAMING_PREFERENCE,
+ &req, sizeof(struct treq_network_set_roaming_preference));
+
+ return TRUE;
+}
+
+static gboolean on_network_get_roaming_preference(TelephonyNetwork *network,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_NETWORK, "r"))
+ return TRUE;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, network, invocation,
+ TREQ_NETWORK_GET_ROAMING_PREFERENCE,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_network_get_network_info(TelephonyNetwork *network,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ TcorePlugin *plugin;
+ CoreObject *co_network;
+ NetworkPropertyInfo network_info;
+ char *cpname;
+ TReturn result = TCORE_RETURN_SUCCESS;
+
+ if (!check_access_control(invocation, AC_NETWORK, "r"))
+ return TRUE;
+
+ cpname = GET_CP_NAME(invocation);
+
+ plugin = tcore_server_find_plugin(ctx->server, cpname);
+ co_network = tcore_plugin_ref_core_object(plugin, CORE_OBJECT_TYPE_NETWORK);
+
+ memset(&network_info, 0x0, sizeof(NetworkPropertyInfo));
+
+ /* Fetch Network information */
+ __get_current_network_status(co_network, &network_info,
+ NET_PROP_SVC_TYPE | NET_PROP_ROAM | NET_PROP_PLMN
+ | NET_PROP_NAME_OPTION | NET_PROP_SPN | NET_PROP_NWNAME);
+
+ network_info.type = (NET_PROP_SVC_TYPE|NET_PROP_ROAM|NET_PROP_NAME_OPTION);
+
+ if (network_info.plmn && strlen(network_info.plmn) != 0)
+ network_info.type |= NET_PROP_PLMN;
+ if (network_info.spn && strlen(network_info.spn) != 0)
+ network_info.type |= NET_PROP_SPN;
+ if (network_info.nwname && strlen(network_info.nwname) != 0)
+ network_info.type |= NET_PROP_NWNAME;
+
+ info("[%s] type:[0x%x] SVC:[%d] Roam:[%d] Name option:[%d] PLMN:[%s] SPN:[%s] NW name:[%s]",
+ cpname, network_info.type, network_info.svc_type, network_info.roaming, network_info.name_option,
+ network_info.plmn, network_info.spn, network_info.nwname);
+
+ /* Send response */
+ telephony_network_complete_get_network_info(network,
+ invocation,
+ network_info.type, network_info.svc_type,
+ network_info.roaming, network_info.name_option,
+ network_info.plmn, network_info.spn, network_info.nwname,
+ result);
+
+ return TRUE;
+}
+
+gboolean dbus_plugin_setup_network_interface(TelephonyObjectSkeleton *object,
+ struct custom_data *ctx)
+{
+ TelephonyNetwork *network;
+
+ network = telephony_network_skeleton_new();
+ telephony_object_skeleton_set_network(object, network);
+ g_object_unref(network);
+
+ dbg("network = %p", network);
+
+ /*
+ * Register signal handlers for Network interface
+ */
+ g_signal_connect(network,
+ "handle-search",
+ G_CALLBACK(on_network_search), ctx);
+
+ g_signal_connect(network,
+ "handle-search-cancel",
+ G_CALLBACK(on_network_search_cancel), ctx);
+
+ g_signal_connect(network,
+ "handle-set-selection-mode",
+ G_CALLBACK(on_network_set_selection_mode), ctx);
+
+ g_signal_connect(network,
+ "handle-get-selection-mode",
+ G_CALLBACK(on_network_get_selection_mode), ctx);
+
+ g_signal_connect(network,
+ "handle-set-service-domain",
+ G_CALLBACK(on_network_set_service_domain), ctx);
+
+ g_signal_connect(network,
+ "handle-get-service-domain",
+ G_CALLBACK(on_network_get_service_domain), ctx);
+
+ g_signal_connect(network,
+ "handle-set-band",
+ G_CALLBACK(on_network_set_band), ctx);
+
+ g_signal_connect(network,
+ "handle-get-band",
+ G_CALLBACK(on_network_get_band), ctx);
+
+ g_signal_connect(network,
+ "handle-set-mode",
+ G_CALLBACK(on_network_set_mode), ctx);
+
+ g_signal_connect(network,
+ "handle-get-mode",
+ G_CALLBACK(on_network_get_mode), ctx);
+
+ g_signal_connect(network,
+ "handle-set-preferred-plmn",
+ G_CALLBACK(on_network_set_preferred_plmn), ctx);
+
+ g_signal_connect(network,
+ "handle-get-preferred-plmn",
+ G_CALLBACK(on_network_get_preferred_plmn), ctx);
+
+ g_signal_connect(network,
+ "handle-get-serving-network",
+ G_CALLBACK(on_network_get_serving_network), ctx);
+
+ g_signal_connect(network,
+ "handle-get-ngbr-cell-info",
+ G_CALLBACK(on_network_get_neighboring_cell_info), ctx);
+
+ g_signal_connect(network,
+ "handle-set-default-data-subscription",
+ G_CALLBACK(on_network_set_default_data_subscription), ctx);
+
+ g_signal_connect(network,
+ "handle-get-default-data-subscription",
+ G_CALLBACK(on_network_get_default_data_subscription), ctx);
+
+ g_signal_connect(network,
+ "handle-set-default-subscription",
+ G_CALLBACK(on_network_set_default_subs), ctx);
+
+ g_signal_connect(network,
+ "handle-get-default-subscription",
+ G_CALLBACK(on_network_get_default_subs), ctx);
+
+ g_signal_connect(network,
+ "handle-set-emergency-callback-mode",
+ G_CALLBACK(on_network_set_emergency_callback_mode), ctx);
+
+ g_signal_connect(network,
+ "handle-set-roaming-preference",
+ G_CALLBACK(on_network_set_roaming_preference), ctx);
+
+ g_signal_connect(network,
+ "handle-get-roaming-preference",
+ G_CALLBACK(on_network_get_roaming_preference), ctx);
+
+ g_signal_connect(network,
+ "handle-get-network-info",
+ G_CALLBACK(on_network_get_network_info), ctx);
+
+ /*
+ * Initialize DBUS properties
+ */
+ telephony_network_set_access_technology(network, NETWORK_ACT_UNKNOWN);
+ telephony_network_set_cell_id(network, 0);
+ telephony_network_set_ims_voice_status(network, NETWORK_IMS_VOICE_UNKNOWN);
+ telephony_network_set_volte_enable(network, FALSE);
+ telephony_network_set_circuit_status(network, NETWORK_SERVICE_DOMAIN_STATUS_NO);
+ telephony_network_set_lac(network, 0);
+ telephony_network_set_name_option(network, NETWORK_NAME_OPTION_NONE);
+ telephony_network_set_packet_status(network, NETWORK_SERVICE_DOMAIN_STATUS_NO);
+ telephony_network_set_sig_dbm(network, 0);
+ telephony_network_set_roaming_status(network, FALSE);
+ telephony_network_set_ps_type(network, TELEPHONY_HSDPA_OFF);
+ telephony_network_set_service_type(network, NETWORK_SERVICE_TYPE_UNKNOWN);
+ telephony_network_set_sig_level(network, 0);
+ telephony_network_set_plmn(network, NULL);
+ telephony_network_set_spn_name(network, NULL);
+ telephony_network_set_network_name(network, NULL);
+
+ tcore_server_remove_notification_hook(ctx->server, on_hook_ps_protocol_status);
+ tcore_server_add_notification_hook(ctx->server,
+ TNOTI_PS_PROTOCOL_STATUS, on_hook_ps_protocol_status, ctx);
+
+ return TRUE;
+}
+
+gboolean dbus_plugin_network_response(struct custom_data *ctx,
+ UserRequest *ur, struct dbus_request_info *dbus_info,
+ enum tcore_response_command command, unsigned int data_len, const void *data)
+{
+ char *cpname = dbus_info ? GET_CP_NAME(dbus_info->invocation) : "";
+
+ switch (command) {
+ case TRESP_NETWORK_SEARCH: {
+ const struct tresp_network_search *resp_network_search = data;
+ GVariant *network_search_result = NULL;
+ GVariantBuilder b;
+ int i = 0;
+
+ info("[%s] NETWORK_SEARCH - [%s] Count: [%d]",
+ cpname, (resp_network_search->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"),
+ resp_network_search->list_count);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+ for (i = 0; i < resp_network_search->list_count; i++) {
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+
+ g_variant_builder_add(&b, "{sv}", "plmn", g_variant_new_string(resp_network_search->list[i].plmn));
+ g_variant_builder_add(&b, "{sv}", "act", g_variant_new_int32(resp_network_search->list[i].act));
+ g_variant_builder_add(&b, "{sv}", "type", g_variant_new_int32(resp_network_search->list[i].status));
+ g_variant_builder_add(&b, "{sv}", "name", g_variant_new_string(resp_network_search->list[i].name));
+
+ g_variant_builder_close(&b);
+ }
+ network_search_result = g_variant_builder_end(&b);
+
+ telephony_network_complete_search(dbus_info->interface_object,
+ dbus_info->invocation,
+ network_search_result, resp_network_search->result);
+ }
+ break;
+
+ case TRESP_NETWORK_SET_PLMN_SELECTION_MODE: {
+ const struct tresp_network_set_plmn_selection_mode *resp_set_plmn_selection_mode = data;
+
+ info("[%s] NETWORK_SET_PLMN_SELECTION_MODE - [%s]", cpname,
+ (resp_set_plmn_selection_mode->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"));
+
+ telephony_network_complete_set_selection_mode(dbus_info->interface_object,
+ dbus_info->invocation, resp_set_plmn_selection_mode->result);
+ }
+ break;
+
+ case TRESP_NETWORK_GET_PLMN_SELECTION_MODE: {
+ const struct tresp_network_get_plmn_selection_mode *resp_get_plmn_selection_mode = data;
+
+ info("[%s] NETWORK_GET_PLMN_SELECTION_MODE - [%s] Mode: [%s]", cpname,
+ (resp_get_plmn_selection_mode->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"),
+ (resp_get_plmn_selection_mode->mode == NETWORK_SELECT_MODE_AUTOMATIC ? "AUTO" :
+ (resp_get_plmn_selection_mode->mode == NETWORK_SELECT_MODE_MANUAL ? "MANUAL" :
+ "UNKNOWN")));
+
+ switch (resp_get_plmn_selection_mode->mode) {
+ case NETWORK_SELECT_MODE_AUTOMATIC:
+ telephony_network_complete_get_selection_mode(dbus_info->interface_object,
+ dbus_info->invocation, 0, resp_get_plmn_selection_mode->result);
+ break;
+
+ case NETWORK_SELECT_MODE_MANUAL:
+ telephony_network_complete_get_selection_mode(dbus_info->interface_object,
+ dbus_info->invocation, 1, resp_get_plmn_selection_mode->result);
+ break;
+
+ default:
+ telephony_network_complete_get_selection_mode(dbus_info->interface_object,
+ dbus_info->invocation, -1, resp_get_plmn_selection_mode->result);
+ break;
+ }
+ }
+ break;
+
+ case TRESP_NETWORK_SET_SERVICE_DOMAIN: {
+ const struct tresp_network_set_service_domain *resp_set_service_domain = data;
+
+ dbg("[%s] NETWORK_SET_SERVICE_DOMAIN - [%s]", cpname,
+ (resp_set_service_domain->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"));
+
+ telephony_network_complete_set_service_domain(dbus_info->interface_object,
+ dbus_info->invocation, resp_set_service_domain->result);
+ }
+ break;
+
+ case TRESP_NETWORK_GET_SERVICE_DOMAIN: {
+ const struct tresp_network_get_service_domain *resp_get_service_domain = data;
+
+ dbg("[%s] NETWORK_GET_SERVICE_DOMAIN - [%s] Domain: [%d]", cpname,
+ (resp_get_service_domain->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"),
+ resp_get_service_domain->domain);
+
+ telephony_network_complete_get_service_domain(dbus_info->interface_object,
+ dbus_info->invocation,
+ resp_get_service_domain->domain, resp_get_service_domain->result);
+ }
+ break;
+
+ case TRESP_NETWORK_SET_BAND: {
+ const struct tresp_network_set_band *resp_set_band = data;
+
+ dbg("[%s] NETWORK_SET_BAND - [%s]", cpname,
+ (resp_set_band->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"));
+
+ telephony_network_complete_set_band(dbus_info->interface_object,
+ dbus_info->invocation, resp_set_band->result);
+ }
+ break;
+
+ case TRESP_NETWORK_GET_BAND: {
+ const struct tresp_network_get_band *resp_get_band = data;
+
+ dbg("[%s] NETWORK_GET_BAND - [%s] Mode: [%s] Band: [%d]", cpname,
+ (resp_get_band->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"),
+ (resp_get_band->mode == NETWORK_BAND_MODE_PREFERRED ? "PREFERRED" :
+ (resp_get_band->mode == NETWORK_BAND_MODE_ONLY ? "ONLY" :
+ "UNKNOWN")), resp_get_band->band);
+
+ telephony_network_complete_get_band(dbus_info->interface_object,
+ dbus_info->invocation,
+ resp_get_band->band, resp_get_band->mode, resp_get_band->result);
+ }
+ break;
+
+ case TRESP_NETWORK_SET_MODE: {
+ const struct tresp_network_set_mode *resp_set_mode = data;
+
+ dbg("[%s] NETWORK_SET_MODE - [%s]", cpname,
+ (resp_set_mode->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"));
+
+ telephony_network_complete_set_mode(dbus_info->interface_object,
+ dbus_info->invocation, resp_set_mode->result);
+ }
+ break;
+
+ case TRESP_NETWORK_GET_MODE: {
+ const struct tresp_network_get_mode *resp_get_mode = data;
+
+ dbg("[%s] NETWORK_GET_MODE - [%s] Mode: [%d]", cpname,
+ (resp_get_mode->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"),
+ resp_get_mode->mode);
+
+ telephony_network_complete_get_mode(dbus_info->interface_object,
+ dbus_info->invocation,
+ resp_get_mode->mode, resp_get_mode->result);
+ }
+ break;
+
+ case TRESP_NETWORK_GET_NEIGHBORING_CELL_INFO: {
+ const struct tresp_network_get_neighboring_cell_info *resp_get_ngbr_cell_info = data;
+ GVariant *neighboring_cell_info_result = NULL;
+ GVariant *value = NULL;
+ GVariantBuilder b;
+ enum telephony_network_access_technology act;
+ int i = 0;
+
+ dbg("[%s] NETWORK_GET_NEIGHBORING_CELL_INFO - [%s]", cpname,
+ (resp_get_ngbr_cell_info->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"));
+
+ act = resp_get_ngbr_cell_info->info.serving.act;
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+
+ /*
+ * Fill Serving cell parameter
+ */
+ value = g_variant_new("(iii)",
+ resp_get_ngbr_cell_info->info.serving.act,
+ resp_get_ngbr_cell_info->info.serving.mcc,
+ resp_get_ngbr_cell_info->info.serving.mnc);
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "serving", value);
+ g_variant_builder_close(&b);
+
+ if (act >= NETWORK_ACT_GSM && act <= NETWORK_ACT_EGPRS) {
+ value = g_variant_new("(iiiii)",
+ resp_get_ngbr_cell_info->info.serving.cell.geran.cell_id,
+ resp_get_ngbr_cell_info->info.serving.cell.geran.lac,
+ resp_get_ngbr_cell_info->info.serving.cell.geran.bcch,
+ resp_get_ngbr_cell_info->info.serving.cell.geran.bsic,
+ resp_get_ngbr_cell_info->info.serving.cell.geran.rxlev);
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "g_serving", value);
+ g_variant_builder_close(&b);
+ } else if (act >= NETWORK_ACT_UMTS && act <= NETWORK_ACT_GSM_UTRAN) {
+ value = g_variant_new("(iiiii)",
+ resp_get_ngbr_cell_info->info.serving.cell.umts.cell_id,
+ resp_get_ngbr_cell_info->info.serving.cell.umts.lac,
+ resp_get_ngbr_cell_info->info.serving.cell.umts.arfcn,
+ resp_get_ngbr_cell_info->info.serving.cell.umts.psc,
+ resp_get_ngbr_cell_info->info.serving.cell.umts.rscp);
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "u_serving", value);
+ g_variant_builder_close(&b);
+ } else if (act == NETWORK_ACT_LTE) {
+ value = g_variant_new("(iiiii)",
+ resp_get_ngbr_cell_info->info.serving.cell.lte.cell_id,
+ resp_get_ngbr_cell_info->info.serving.cell.lte.lac,
+ resp_get_ngbr_cell_info->info.serving.cell.lte.earfcn,
+ resp_get_ngbr_cell_info->info.serving.cell.lte.tac,
+ resp_get_ngbr_cell_info->info.serving.cell.lte.rssi);
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "l_serving", value);
+ g_variant_builder_close(&b);
+ } else if (act >= NETWORK_ACT_IS95A && act <= NETWORK_ACT_EHRPD) {
+ value = g_variant_new("(uuuuii)",
+ resp_get_ngbr_cell_info->info.serving.cell.cdma.sid,
+ resp_get_ngbr_cell_info->info.serving.cell.cdma.nid,
+ resp_get_ngbr_cell_info->info.serving.cell.cdma.base_id,
+ resp_get_ngbr_cell_info->info.serving.cell.cdma.refpn,
+ resp_get_ngbr_cell_info->info.serving.cell.cdma.base_lat,
+ resp_get_ngbr_cell_info->info.serving.cell.cdma.base_long);
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "c_serving", value);
+ g_variant_builder_close(&b);
+ }
+
+ /*
+ * Fill GERAN neighbor cell parameter
+ */
+ for (i = 0; i < resp_get_ngbr_cell_info->info.geran_list_count; i++) {
+ value = g_variant_new("(iiiii)",
+ resp_get_ngbr_cell_info->info.geran_list[i].cell_id,
+ resp_get_ngbr_cell_info->info.geran_list[i].lac,
+ resp_get_ngbr_cell_info->info.geran_list[i].bcch,
+ resp_get_ngbr_cell_info->info.geran_list[i].bsic,
+ resp_get_ngbr_cell_info->info.geran_list[i].rxlev);
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "geran", value);
+ g_variant_builder_close(&b);
+ }
+
+ /*
+ * Fill UMTS neighbor cell parameter
+ */
+ for (i = 0; i < resp_get_ngbr_cell_info->info.umts_list_count; i++) {
+ value = g_variant_new("(iiiii)",
+ resp_get_ngbr_cell_info->info.umts_list[i].cell_id,
+ resp_get_ngbr_cell_info->info.umts_list[i].lac,
+ resp_get_ngbr_cell_info->info.umts_list[i].arfcn,
+ resp_get_ngbr_cell_info->info.umts_list[i].psc,
+ resp_get_ngbr_cell_info->info.umts_list[i].rscp);
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "umts", value);
+ g_variant_builder_close(&b);
+ }
+ neighboring_cell_info_result = g_variant_builder_end(&b);
+
+ telephony_network_complete_get_ngbr_cell_info(dbus_info->interface_object,
+ dbus_info->invocation,
+ neighboring_cell_info_result, resp_get_ngbr_cell_info->result);
+ }
+ break;
+
+ case TRESP_NETWORK_SET_PREFERRED_PLMN: {
+ const struct tresp_network_set_preferred_plmn *resp_set_preferred_plmn = data;
+
+ dbg("[%s] NETWORK_SET_PREFERRED_PLMN - [%s]", cpname,
+ (resp_set_preferred_plmn->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"));
+
+ telephony_network_complete_set_preferred_plmn(dbus_info->interface_object,
+ dbus_info->invocation, resp_set_preferred_plmn->result);
+ }
+ break;
+
+ case TRESP_NETWORK_GET_PREFERRED_PLMN: {
+ const struct tresp_network_get_preferred_plmn *resp_get_preferred_plmn = data;
+ GVariant *preferred_plmn_result = NULL;
+ GVariantBuilder b;
+ int i = 0;
+
+ dbg("[%s] NETWORK_GET_PREFERRED_PLMN - [%s] Count: [%d]", cpname,
+ (resp_get_preferred_plmn->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"),
+ resp_get_preferred_plmn->list_count);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+ for (i = 0; i < resp_get_preferred_plmn->list_count; i++) {
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+
+ g_variant_builder_add(&b, "{sv}", "plmn",
+ g_variant_new_string(resp_get_preferred_plmn->list[i].plmn));
+ g_variant_builder_add(&b, "{sv}", "act",
+ g_variant_new_int32(resp_get_preferred_plmn->list[i].act));
+ g_variant_builder_add(&b, "{sv}", "index",
+ g_variant_new_int32(resp_get_preferred_plmn->list[i].ef_index));
+ g_variant_builder_add(&b, "{sv}", "name",
+ g_variant_new_string(resp_get_preferred_plmn->list[i].name));
+
+ g_variant_builder_close(&b);
+ }
+ preferred_plmn_result = g_variant_builder_end(&b);
+
+ telephony_network_complete_get_preferred_plmn(dbus_info->interface_object,
+ dbus_info->invocation,
+ preferred_plmn_result, resp_get_preferred_plmn->result);
+ }
+ break;
+
+ case TRESP_NETWORK_SET_CANCEL_MANUAL_SEARCH: {
+ const struct tresp_network_set_cancel_manual_search *resp_set_cancel_manual_search = data;
+
+ info("[%s] NETWORK_SET_CANCEL_MANUAL_SEARCH - [%s]", cpname,
+ (resp_set_cancel_manual_search->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"));
+
+ telephony_network_complete_search_cancel(dbus_info->interface_object,
+ dbus_info->invocation, resp_set_cancel_manual_search->result);
+ }
+ break;
+
+ case TRESP_NETWORK_GET_SERVING_NETWORK: {
+ const struct tresp_network_get_serving_network *resp_get_serving_network = data;
+ GVariant *serving_network = NULL;
+ GVariant *value = NULL;
+ GVariantBuilder b;
+
+ enum telephony_network_access_technology act;
+
+ dbg("[%s] NETWORK_GET_SERVING_NETWORK - [%s] AcT: [%d] PLMN: [%s] LAC: [%d]", cpname,
+ (resp_get_serving_network->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"),
+ resp_get_serving_network->act, resp_get_serving_network->plmn,
+ resp_get_serving_network->gsm.lac);
+
+ act = resp_get_serving_network->act;
+ g_variant_builder_init(&b, G_VARIANT_TYPE("a{sv}"));
+
+ /*
+ * Fill Serving cell parameter
+ */
+ value = g_variant_new("(is)",
+ resp_get_serving_network->act,
+ resp_get_serving_network->plmn);
+
+ g_variant_builder_add(&b, "{sv}", "serving", value);
+ if ((act >= NETWORK_ACT_GSM
+ && act <= NETWORK_ACT_GSM_UTRAN)
+ || act == NETWORK_ACT_LTE) {
+ dbg("lac: [%d]", resp_get_serving_network->gsm.lac);
+
+ value = g_variant_new("(i)",
+ resp_get_serving_network->gsm.lac);
+ g_variant_builder_add(&b, "{sv}", "g_serving", value);
+ } else if (act >= NETWORK_ACT_IS95A
+ && act <= NETWORK_ACT_EHRPD) {
+ dbg("carrier: [%d] sid: [%d] nid: [%d] bs_id: [%d] " \
+ "bs_lat: [%d] bs_long: [%d] reg_zone: [%d] pilot_pn: [%d]",
+ resp_get_serving_network->cdma.carrier,
+ resp_get_serving_network->cdma.sid,
+ resp_get_serving_network->cdma.nid,
+ resp_get_serving_network->cdma.bs_id,
+ resp_get_serving_network->cdma.bs_lat,
+ resp_get_serving_network->cdma.bs_long,
+ resp_get_serving_network->cdma.reg_zone,
+ resp_get_serving_network->cdma.pilot_pn);
+
+ value = g_variant_new("(iuuuiiuu)",
+ resp_get_serving_network->cdma.carrier,
+ resp_get_serving_network->cdma.sid,
+ resp_get_serving_network->cdma.nid,
+ resp_get_serving_network->cdma.bs_id,
+ resp_get_serving_network->cdma.bs_lat,
+ resp_get_serving_network->cdma.bs_long,
+ resp_get_serving_network->cdma.reg_zone,
+ resp_get_serving_network->cdma.pilot_pn);
+ g_variant_builder_add(&b, "{sv}", "c_serving", value);
+ }
+ serving_network = g_variant_builder_end(&b);
+
+ telephony_network_complete_get_serving_network(dbus_info->interface_object,
+ dbus_info->invocation,
+ serving_network, resp_get_serving_network->result);
+ }
+ break;
+
+ case TRESP_NETWORK_SET_DEFAULT_DATA_SUBSCRIPTION: {
+ const struct tresp_network_set_default_data_subscription *resp_set_default_data_subs = data;
+
+ info("[%s] NETWORK_SET_DEFAULT_DATA_SUBSCRIPTION - [%s]", cpname,
+ (resp_set_default_data_subs->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"));
+
+ telephony_network_complete_set_default_data_subscription(dbus_info->interface_object,
+ dbus_info->invocation, resp_set_default_data_subs->result);
+ }
+ break;
+
+ case TRESP_NETWORK_GET_DEFAULT_DATA_SUBSCRIPTION: {
+ const struct tresp_network_get_default_data_subs *resp_get_default_data_subs = data;
+
+ dbg("[%s] NETWORK_GET_DEFAULT_DATA_SUBSCRIPTION - [%s] 'default' Data subscription: [%s]", cpname,
+ (resp_get_default_data_subs->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"),
+ (resp_get_default_data_subs->default_subs == NETWORK_DEFAULT_DATA_SUBS_SIM1 ? "SIM 1" :
+ (resp_get_default_data_subs->default_subs == NETWORK_DEFAULT_DATA_SUBS_SIM2 ? "SIM 2" :
+ "UNKNWON")));
+
+ telephony_network_complete_get_default_data_subscription(dbus_info->interface_object, dbus_info->invocation,
+ resp_get_default_data_subs->default_subs, resp_get_default_data_subs->result);
+ }
+ break;
+
+ case TRESP_NETWORK_SET_DEFAULT_SUBSCRIPTION: {
+ const struct tresp_network_set_default_subs *resp_set_default_subs = data;
+
+ info("[%s] NETWORK_SET_DEFAULT_SUBSCRIPTION - [%s]", cpname,
+ (resp_set_default_subs->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"));
+
+ telephony_network_complete_set_default_subscription(dbus_info->interface_object,
+ dbus_info->invocation, resp_set_default_subs->result);
+ }
+ break;
+
+ case TRESP_NETWORK_GET_DEFAULT_SUBSCRIPTION: {
+ const struct tresp_network_get_default_subs *resp_get_default_subs = data;
+
+ dbg("[%s] NETWORK_GET_DEFAULT_SUBSCRIPTION - [%s] 'default' subscription: [%s]", cpname,
+ (resp_get_default_subs->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"),
+ (resp_get_default_subs->default_subs == NETWORK_DEFAULT_SUBS_SIM1 ? "SIM 1" :
+ (resp_get_default_subs->default_subs == NETWORK_DEFAULT_SUBS_SIM2 ? "SIM 2" :
+ "UNKNOWN")));
+
+ telephony_network_complete_get_default_subscription(dbus_info->interface_object,
+ dbus_info->invocation,
+ resp_get_default_subs->default_subs, resp_get_default_subs->result);
+ }
+ break;
+
+ case TRESP_NETWORK_SET_EMERGENCY_CALLBACK_MODE: {
+ const struct tresp_network_set_emergency_callback_mode *resp_set_emergency_callback_mode = data;
+
+ info("[%s] NETWORK_SET_EMERGENCY_CALLBACK_MODE - [%s]", cpname,
+ (resp_set_emergency_callback_mode->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"));
+
+ telephony_network_complete_set_emergency_callback_mode(dbus_info->interface_object,
+ dbus_info->invocation, resp_set_emergency_callback_mode->result);
+ }
+ break;
+
+ case TRESP_NETWORK_SET_ROAMING_PREFERENCE: {
+ const struct tresp_network_set_roaming_preference *resp_set_roam_pref = data;
+
+ info("[%s] NETWORK_SET_ROAMING_PREFERENCE - [%s]", cpname,
+ (resp_set_roam_pref->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"));
+
+ telephony_network_complete_set_roaming_preference(dbus_info->interface_object,
+ dbus_info->invocation, resp_set_roam_pref->result);
+ }
+ break;
+
+ case TRESP_NETWORK_GET_ROAMING_PREFERENCE: {
+ const struct tresp_network_get_roaming_preference *resp_get_roam_pref = data;
+
+ dbg("[%s] NETWORK_GET_ROAMING_PREFERENCE - [%s] roam_pref: [%d]", cpname,
+ (resp_get_roam_pref->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"),
+ resp_get_roam_pref->roam_pref);
+
+ telephony_network_complete_get_roaming_preference(dbus_info->interface_object,
+ dbus_info->invocation,
+ resp_get_roam_pref->roam_pref, resp_get_roam_pref->result);
+ }
+ break;
+
+ default:
+ err("Unhandled/Unknown Response: [0x%x]", command);
+ break;
+ }
+
+ return TRUE;
+}
+
+gboolean dbus_plugin_network_notification(struct custom_data *ctx,
+ CoreObject *source, TelephonyObjectSkeleton *object,
+ enum tcore_notification_command command, unsigned int data_len, const void *data)
+{
+ TelephonyNetwork *network;
+ const char *cp_name;
+
+ if (!object) {
+ err("object is NULL");
+ return FALSE;
+ }
+
+ if (!data) {
+ err("data is NULL");
+ return FALSE;
+ }
+
+ cp_name = tcore_server_get_cp_name_by_plugin(tcore_object_ref_plugin(source));
+ network = telephony_object_peek_network(TELEPHONY_OBJECT(object));
+ if (network == NULL) {
+ err("Network object is NULL!!!");
+ return FALSE;
+ }
+
+ switch (command) {
+ case TNOTI_NETWORK_REGISTRATION_STATUS: {
+ const struct tnoti_network_registration_status *reg = data;
+
+ info("[%s] NET_REGI_STATUS - CS: [%d] PS: [%d] SVC: [%d] Roam: [%d]", cp_name,
+ reg->cs_domain_status, reg->ps_domain_status,
+ reg->service_type, reg->roaming_status);
+
+#ifdef ENABLE_KPI_LOGS
+ /* We ignore No SIM present case for KPI */
+ if (reg->cs_domain_status == NETWORK_SERVICE_DOMAIN_STATUS_FULL
+ && telephony_network_get_circuit_status(network) != NETWORK_SERVICE_DOMAIN_STATUS_FULL)
+ TIME_CHECK("[%s] CS Network Full", cp_name);
+
+ if (reg->ps_domain_status == NETWORK_SERVICE_DOMAIN_STATUS_FULL
+ && telephony_network_get_packet_status(network) != NETWORK_SERVICE_DOMAIN_STATUS_FULL)
+ TIME_CHECK("[%s] PS Network Full", cp_name);
+#endif
+ __check_network_properties(network, source, cp_name,
+ (NET_PROP_CS|NET_PROP_PS|NET_PROP_SVC_TYPE|NET_PROP_ROAM));
+
+ /* Emit Signal */
+ telephony_network_emit_registration_status(network,
+ reg->cs_domain_status, reg->ps_domain_status,
+ reg->service_type, reg->roaming_status);
+ }
+ break;
+
+ case TNOTI_NETWORK_CHANGE: {
+ const struct tnoti_network_change *change = data;
+
+ info("[%s] NET_CHANGE - plmn: [%s] lac: [%d]", cp_name,
+ change->plmn, change->gsm.lac);
+
+ /* SPN, NWNAME, NAME_OPTION would have updated on LAC change */
+ __check_network_properties(network, source, cp_name,
+ NET_PROP_PLMN | NET_PROP_NAME_OPTION | NET_PROP_SPN | NET_PROP_NWNAME);
+
+ /* Emit Signal */
+ telephony_network_emit_change(network,
+ change->act, change->plmn);
+ }
+ break;
+
+ case TNOTI_NETWORK_TIMEINFO: {
+ const struct tnoti_network_timeinfo *time_info = data;
+
+ info("[%s] NET_TIMEINFO - [%04d-%02d-%02d] [%02d:%02d:%02d]", cp_name,
+ time_info->year, time_info->month, time_info->day,
+ time_info->hour, time_info->minute, time_info->second);
+
+ /* Emit signal */
+ telephony_network_emit_time_info(network,
+ time_info->year, time_info->month, time_info->day,
+ time_info->hour, time_info->minute, time_info->second,
+ time_info->wday,
+ time_info->gmtoff, time_info->dstoff,
+ time_info->isdst,
+ time_info->plmn);
+ }
+ break;
+
+ case TNOTI_NETWORK_ICON_INFO: {
+ const struct tnoti_network_icon_info *icon_info = data;
+
+ /* Update property */
+ if (icon_info->type & NETWORK_ICON_INFO_RSSI) {
+ info("[%s] NET_ICON_INFO - RSSI: [%d]", cp_name, icon_info->rssi);
+
+ /* Emit signal */
+ telephony_network_set_sig_level(network, icon_info->rssi);
+ }
+ }
+ break;
+
+ case TNOTI_NETWORK_IDENTITY: {
+ const struct tnoti_network_identity *identity = data;
+
+ info("[%s] NET_IDENTITY - long name: [%s] short name: [%s] PLMN: [%s]", cp_name,
+ identity->full_name, identity->short_name, identity->plmn);
+
+ __check_network_properties(network, source, cp_name,
+ (NET_PROP_NAME_OPTION | NET_PROP_SPN | NET_PROP_NWNAME));
+
+ /* Emit Signal */
+ telephony_network_emit_identity(network,
+ identity->plmn, identity->short_name, identity->full_name);
+ }
+ break;
+
+ case TNOTI_NETWORK_LOCATION_CELLINFO: {
+ const struct tnoti_network_location_cellinfo *location = data;
+
+ info("[%s] NET_LOCATION_CELLINFO - LAC: [0x%x] Cell ID: [0x%x]", cp_name,
+ location->lac, location->cell_id);
+
+ /* Update properties */
+ telephony_network_set_lac(network, location->lac);
+ telephony_network_set_cell_id(network, location->cell_id);
+
+ /* Emit signal */
+ telephony_network_emit_cell_info(network,
+ location->lac, location->cell_id);
+ }
+ break;
+
+ case TNOTI_NETWORK_SIGNAL_STRENGTH: {
+ const struct tnoti_network_signal_strength *signal_strength = data;
+
+ info("[%s] NET_SIGNAL_STRENGTH - DBM: [%d]", cp_name,
+ signal_strength->dbm);
+
+ /* Update properties */
+ telephony_network_set_sig_dbm(network, signal_strength->dbm);
+
+ /* Emit signal */
+ telephony_network_emit_signal_strength(network,
+ signal_strength->dbm);
+ }
+ break;
+
+ case TNOTI_NETWORK_DEFAULT_DATA_SUBSCRIPTION: {
+ const struct tnoti_network_default_data_subs *default_data_subs_info = data;
+
+ info("[%s] NET_DEFAULT_DATA_SUBSCRIPTION - 'default' DDS: [%s]", cp_name,
+ (default_data_subs_info->default_subs == NETWORK_DEFAULT_DATA_SUBS_SIM1 ? "SIM 1" :
+ (default_data_subs_info->default_subs == NETWORK_DEFAULT_DATA_SUBS_SIM2 ? "SIM 2" :
+ "UNKNOWN")));
+
+ /* Emit signal */
+ telephony_network_emit_default_data_subscription(network,
+ default_data_subs_info->default_subs);
+ }
+ break;
+
+ case TNOTI_NETWORK_DEFAULT_SUBSCRIPTION: {
+ const struct tnoti_network_default_subs *default_subs_info = data;
+
+ info("[%s] NET_DEFAULT_SUBSCRIPTION - 'default' subscription: [%s]", cp_name,
+ (default_subs_info->default_subs == NETWORK_DEFAULT_SUBS_SIM1 ? "SIM 1" :
+ (default_subs_info->default_subs == NETWORK_DEFAULT_SUBS_SIM2 ? "SIM 2" :
+ "UNKNOWN")));
+
+ /* Emit signal */
+ telephony_network_emit_default_subscription(network,
+ default_subs_info->default_subs);
+ }
+ break;
+
+ case TNOTI_NETWORK_IMS_VOICE_SUPPORT_STATUS: {
+ const struct tnoti_network_ims_voice_status *status = data;
+
+ dbg("[%s] NET_IMS_VOICE_SUPPORT_STATUS - Status: [%s]", cp_name,
+ (status->status == NETWORK_IMS_VOICE_SUPPORT ? "SUPPORTED" :
+ (status->status == NETWORK_IMS_VOICE_NOT_SUPPORT ? "NOT SUPPORTED" :
+ "UNKNOWN")));
+
+ /* Update properties */
+ telephony_network_set_ims_voice_status(network,
+ status->status);
+ }
+ break;
+
+ case TNOTI_NETWORK_EMERGENCY_CALLBACK_MODE: {
+ const struct tnoti_network_emergency_callback_mode *emergency_callback_mode = data;
+
+ dbg("[%s] NET_EMERGENCY_CALLBACK_MODE - Mode: [%s]", cp_name,
+ (emergency_callback_mode->mode == NETWORK_EMERGENCY_CALLBACK_MODE_ENTER ? "ENTER" :
+ (emergency_callback_mode->mode == NETWORK_EMERGENCY_CALLBACK_MODE_EXIT? "EXIT" :
+ "READY")));
+
+ /* Emit signal */
+ telephony_network_emit_emergency_callback_mode(network,
+ emergency_callback_mode->mode);
+ }
+ break;
+
+ default:
+ err("Unhandled/Unknown Notification: [0x%x]", command);
+ break;
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * tel-plugin-dbus-tapi
+ *
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Ja-young Gu <jygu@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
#include <stdio.h>
-#include <string.h>
-#include <pthread.h>
-#include <unistd.h>
#include <stdlib.h>
-#include <time.h>
+
#include <glib.h>
-#include <gio/gio.h>
#include <tcore.h>
-#include <server.h>
-#include <plugin.h>
-#include <hal.h>
#include <communicator.h>
-#include <queue.h>
#include <user_request.h>
#include "generated-code.h"
-#include "common.h"
+#include "dtapi_common.h"
-#define TYPE_FACTORY 0x00020000
-#define MAKE_REQ_CMD(id) (TREQ_CUSTOM|TYPE_FACTORY|id)
-#define GET_OEM_ID(cmd) (cmd&0x0000FFFF)
+#define TYPE_FACTORY (0x00020000)
+#define MAKE_REQ_CMD(id) (TREQ_CUSTOM | TYPE_FACTORY | id)
+#define GET_OEM_ID(cmd) (cmd & 0x0000FFFF)
-static void _emit_oem_response(struct dbus_request_info *dbus_info, int oem_id, const void *data, unsigned int data_len)
+static void _emit_oem_response(struct dbus_request_info *dbus_info,
+ int oem_id, const void *data, unsigned int data_len)
{
if (!dbus_info || !oem_id || !data || !data_len) {
- dbg("Invalid Data! dbus_info=%p, oem_id=0x%x, data=%p, data_len=%d", dbus_info, oem_id, data, data_len);
- return ;
+ dbg("Invalid Data! dbus_info=%p, oem_id=0x%x, data=%p, data_len=%d",
+ dbus_info, oem_id, data, data_len);
+ return;
}
if (dbus_info->interface_object) {
gchar *encoded_data = g_base64_encode((const guchar*)data, data_len);
- if (dbus_info->invocation) {
- telephony_oem_complete_send_oem_data_with_response(dbus_info->interface_object, dbus_info->invocation, oem_id, encoded_data);
- } else {
+
+ /*
+ * Send Response if invocation is non-null,
+ * else Send Notification.
+ */
+ if (dbus_info->invocation)
+ telephony_oem_complete_send_oem_data_with_response(dbus_info->interface_object,
+ dbus_info->invocation, oem_id, encoded_data);
+ else
telephony_oem_emit_oem_data(dbus_info->interface_object, oem_id, encoded_data);
- }
+
g_free(encoded_data);
}
}
-static void _emit_oem_notification(TelephonyOEM *oem, int oem_id, const void *data, unsigned int data_len)
+static void _emit_oem_notification(TelephonyOEM *oem,
+ int oem_id, const void *data, unsigned int data_len)
{
gchar *encoded_data = NULL;
if (!oem || !oem_id || !data || !data_len) {
- dbg("Invalid Data! oem=%p, oem_id=0x%x, data=%p, data_len=%d", oem, oem_id, data, data_len);
- return ;
+ dbg("Invalid Data! oem_id=0x%x, data=%p, data_len=%d",
+ oem_id, data, data_len);
+ return;
}
encoded_data = g_base64_encode((const guchar*)data, data_len);
g_free(encoded_data);
}
-static gboolean
-send_oem_data(TelephonyOEM *oem,
+static gboolean send_oem_data(TelephonyOEM *oem,
GDBusMethodInvocation *invocation,
gint arg_oem_id,
const gchar *arg_data,
guchar *decoded_data = NULL;
gsize length;
- if (!check_access_control (invocation, AC_MODEM, "w"))
+ if (!check_access_control(invocation, AC_MODEM, "w"))
return TRUE;
ur = MAKE_UR(ctx, oem, invocation);
- decoded_data = g_base64_decode(arg_data, &length);
+ decoded_data = g_base64_decode(arg_data, &length);
tcore_user_request_set_data(ur, length, decoded_data);
g_free(decoded_data);
ret = tcore_communicator_dispatch_request(ctx->comm, ur);
if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
+ FAIL_RESPONSE(invocation, DEFAULT_MSG_REQ_FAILED);
tcore_user_request_unref(ur);
return TRUE;
}
telephony_oem_complete_send_oem_data(oem, invocation, result);
}
+
return TRUE;
}
-static gboolean
-on_send_oem_data (TelephonyOEM *oem,
+static gboolean on_send_oem_data(TelephonyOEM *oem,
GDBusMethodInvocation *invocation,
gint arg_oem_id,
const gchar *arg_data,
return send_oem_data(oem, invocation, arg_oem_id, arg_data, user_data, TRUE);
}
-static gboolean
-on_send_oem_data_with_response (TelephonyOEM *oem,
+static gboolean on_send_oem_data_with_response(TelephonyOEM *oem,
GDBusMethodInvocation *invocation,
gint arg_oem_id,
const gchar *arg_data,
return send_oem_data(oem, invocation, arg_oem_id, arg_data, user_data, FALSE);
}
-gboolean dbus_plugin_setup_oem_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx)
+gboolean dbus_plugin_setup_oem_interface(TelephonyObjectSkeleton *object,
+ struct custom_data *ctx)
{
TelephonyOEM *oem;
dbg("oem = %p", oem);
- g_signal_connect (oem,
- "handle-send-oem-data",
- G_CALLBACK (on_send_oem_data),
- ctx);
+ /*
+ * Register signal handlers for OEM interface
+ */
+ g_signal_connect(oem,
+ "handle-send-oem-data",
+ G_CALLBACK(on_send_oem_data), ctx);
- g_signal_connect (oem,
- "handle-send-oem-data-with-response",
- G_CALLBACK (on_send_oem_data_with_response),
- ctx);
+ g_signal_connect(oem,
+ "handle-send-oem-data-with-response",
+ G_CALLBACK(on_send_oem_data_with_response), ctx);
return TRUE;
}
-gboolean dbus_plugin_oem_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data)
+gboolean dbus_plugin_oem_response(struct custom_data *ctx,
+ UserRequest *ur, struct dbus_request_info *dbus_info,
+ enum tcore_response_command command, unsigned int data_len, const void *data)
{
_emit_oem_response(dbus_info, GET_OEM_ID(command), data, data_len);
- return TRUE;
+
+ return TRUE;
}
-gboolean dbus_plugin_oem_notification(struct custom_data *ctx, CoreObject *source, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data)
+gboolean dbus_plugin_oem_notification(struct custom_data *ctx,
+ CoreObject *source, TelephonyObjectSkeleton *object,
+ enum tcore_notification_command command, unsigned int data_len, const void *data)
{
- _emit_oem_notification(telephony_object_peek_oem(TELEPHONY_OBJECT(object)), GET_OEM_ID(command), data, data_len);
+ _emit_oem_notification(telephony_object_peek_oem(TELEPHONY_OBJECT(object)),
+ GET_OEM_ID(command), data, data_len);
+
return TRUE;
}
--- /dev/null
+/*
+ * tel-plugin-dbus-tapi
+ *
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Ja-young Gu <jygu@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <glib.h>
+
+#include <tcore.h>
+#include <server.h>
+#include <plugin.h>
+#include <co_phonebook.h>
+
+#include "generated-code.h"
+#include "dtapi_common.h"
+
+/*
+ * Printable values for debugging/logging
+ */
+static const char *dbg_dbus_pb_type_name[] = {
+ "PB_TYPE_FDN", "PB_TYPE_ADN", "PB_TYPE_SDN",
+ "PB_TYPE_USIM", "PB_TYPE_AAS", "PB_TYPE_GAS"
+};
+
+static const char *dbg_dbus_pb_adf_field_name[] = {
+ "NO VALUE 0", "PB_FIELD_NAME", "PB_FIELD_NUMBER",
+ "PB_FIELD_ANR1", "PB_FIELD_ANR2", "PB_FIELD_ANR3",
+ "PB_FIELD_EMAIL1", "PB_FIELD_EMAIL2", "PB_FIELD_EMAIL3", "PB_FIELD_EMAIL4",
+ "PB_FIELD_SNE", "PB_FIELD_GRP", "PB_FIELD_PBC"
+};
+
+static const char *dbg_dbus_pb_ton_name[] = {
+ "PB_TON_UNKNOWN",
+ "PB_TON_INTERNATIONAL",
+ "PB_TON_NATIONAL",
+ "PB_TON_NETWORK_SPECIFIC",
+ "PB_TON_DEDICATED_ACCESS",
+ "PB_TON_ALPHA_NUMERIC",
+ "PB_TON_ABBREVIATED_NUMBER",
+ "PB_TON_RESERVED_FOR_EXT"
+};
+
+#define DBUS_PBM_GET_CO_PBM(invocation, co_pbm, server) do { \
+ co_pbm = __get_pbm_co_by_cp_name(server, GET_CP_NAME(invocation)); \
+ if (!co_pbm) { \
+ err("[%s] PBM Core object is NULL", GET_CP_NAME(invocation)); \
+ FAIL_RESPONSE(invocation, DEFAULT_MSG_REQ_FAILED); \
+ return TRUE; \
+ } \
+} while (0)
+
+static CoreObject *__get_pbm_co_by_cp_name(Server *server, char *cp_name)
+{
+ TcorePlugin *plugin = NULL;
+
+ if (!server) {
+ err("server is NULL");
+ return NULL;
+ }
+
+ plugin = tcore_server_find_plugin(server, cp_name);
+ return tcore_plugin_ref_core_object(plugin, CORE_OBJECT_TYPE_PHONEBOOK);
+}
+
+static gboolean on_phonebook_get_init_status(TelephonyPhonebook *phonebook,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ gboolean pb_status = FALSE;
+ struct tel_phonebook_support_list *list = NULL;
+ CoreObject *co_pb = NULL;
+
+ if (!check_access_control(invocation, AC_PHONEBOOK, "r"))
+ return TRUE;
+
+ DBUS_PBM_GET_CO_PBM(invocation, co_pb, ctx->server);
+ pb_status = tcore_phonebook_get_status(co_pb);
+ if (pb_status == FALSE) {
+ /*
+ *Phonebook is NOT initialized
+ */
+ dbg("pb_init is not completed yet.");
+
+ telephony_phonebook_complete_get_init_status(phonebook,
+ invocation, pb_status,
+ FALSE, /* FDN */
+ FALSE, /* ADN */
+ FALSE, /* SDN */
+ FALSE, /* USIM */
+ FALSE, /* AAS */
+ FALSE); /* GAS */
+
+ return TRUE;
+ }
+
+ list = tcore_phonebook_get_support_list(co_pb);
+ if (!list) {
+ err("Supported phonebook list is NULL");
+ FAIL_RESPONSE(invocation, DEFAULT_MSG_REQ_FAILED);
+ return TRUE;
+ }
+
+ dbg("[%s] fdn[%d],adn[%d],sdn[%d],usim[%d],aas[%d],gas[%d]",
+ GET_CP_NAME(invocation),
+ list->b_fdn, list->b_adn, list->b_sdn,
+ list->b_usim, list->b_aas, list->b_gas);
+
+ telephony_phonebook_complete_get_init_status(phonebook,
+ invocation, pb_status,
+ list->b_fdn,
+ list->b_adn,
+ list->b_sdn,
+ list->b_usim,
+ list->b_aas,
+ list->b_gas);
+ g_free(list);
+
+ return TRUE;
+}
+
+static gboolean on_phonebook_get_count(TelephonyPhonebook *phonebook,
+ GDBusMethodInvocation *invocation, gint req_type, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ struct treq_phonebook_get_count req;
+ CoreObject *co_pb = NULL;
+ gboolean pb_status = FALSE;
+
+ if (!check_access_control(invocation, AC_PHONEBOOK, "r"))
+ return TRUE;
+
+ DBUS_PBM_GET_CO_PBM(invocation, co_pb, ctx->server);
+ pb_status = tcore_phonebook_get_status(co_pb);
+ if (pb_status == FALSE) {
+ dbg("pb_init is not completed yet.");
+
+ telephony_phonebook_complete_get_count(phonebook,
+ invocation, PB_ACCESS_CONDITION_NOT_SATISFIED, 0, 0, 0);
+
+ return TRUE;
+ }
+
+ memset(&req, 0x0, sizeof(struct treq_phonebook_get_count));
+
+ req.phonebook_type = req_type;
+ dbg("[%s] req phonebook_type[%d][%s]", GET_CP_NAME(invocation),
+ req.phonebook_type, dbg_dbus_pb_type_name[req.phonebook_type]);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, phonebook, invocation,
+ TREQ_PHONEBOOK_GETCOUNT,
+ &req, sizeof(struct treq_phonebook_get_count));
+
+ return TRUE;
+}
+
+static gboolean on_phonebook_get_info(TelephonyPhonebook *phonebook,
+ GDBusMethodInvocation *invocation, gint req_type, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ struct treq_phonebook_get_info req;
+ CoreObject *co_pb = NULL;
+ gboolean pb_status = FALSE;
+
+ if (!check_access_control(invocation, AC_PHONEBOOK, "r"))
+ return TRUE;
+
+ DBUS_PBM_GET_CO_PBM(invocation, co_pb, ctx->server);
+ pb_status = tcore_phonebook_get_status(co_pb);
+ if (pb_status == FALSE) {
+ dbg("pb_init is not completed yet.");
+
+ telephony_phonebook_complete_get_info(phonebook, invocation,
+ PB_ACCESS_CONDITION_NOT_SATISFIED, 0, 0, 0, 0, 0, 0);
+
+ return TRUE;
+ }
+
+ memset(&req, 0x0, sizeof(struct treq_phonebook_get_info));
+
+ req.phonebook_type = req_type;
+
+ dbg("[%s] req phonebook_type[%d][%s]", GET_CP_NAME(invocation),
+ req.phonebook_type,
+ dbg_dbus_pb_type_name[req.phonebook_type]);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, phonebook, invocation,
+ TREQ_PHONEBOOK_GETMETAINFO,
+ &req, sizeof(struct treq_phonebook_get_info));
+
+ return TRUE;
+}
+
+static gboolean on_phonebook_get_usim_info(TelephonyPhonebook *phonebook,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ CoreObject *co_pb = NULL;
+ gboolean pb_status = FALSE;
+
+ if (!check_access_control(invocation, AC_PHONEBOOK, "r"))
+ return TRUE;
+
+ DBUS_PBM_GET_CO_PBM(invocation, co_pb, ctx->server);
+
+ pb_status = tcore_phonebook_get_status(co_pb);
+ if (pb_status == FALSE) {
+ GVariant *gv = NULL;
+ GVariantBuilder b;
+
+ dbg("pb_init is not completed yet.");
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+ gv = g_variant_builder_end(&b);
+
+ telephony_phonebook_complete_get_usim_meta_info(phonebook, invocation,
+ PB_ACCESS_CONDITION_NOT_SATISFIED, gv);
+
+ return TRUE;
+ }
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, phonebook, invocation,
+ TREQ_PHONEBOOK_GETUSIMINFO,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_phonebook_read_record(TelephonyPhonebook *phonebook,
+ GDBusMethodInvocation *invocation,
+ gint req_type, gint index,
+ gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ struct treq_phonebook_read_record req;
+ CoreObject *co_pb = NULL;
+ gboolean pb_status = FALSE;
+
+ if (!check_access_control(invocation, AC_PHONEBOOK, "r"))
+ return TRUE;
+
+ DBUS_PBM_GET_CO_PBM(invocation, co_pb, ctx->server);
+ pb_status = tcore_phonebook_get_status(co_pb);
+ if (pb_status == FALSE) {
+ dbg("pb_init is not completed yet.");
+
+ telephony_phonebook_complete_read_record(phonebook, invocation,
+ PB_ACCESS_CONDITION_NOT_SATISFIED,
+ 0, 0, 0, NULL, 0, NULL, 0, NULL, 0, NULL, 0, NULL,
+ 0, NULL, 0, NULL, NULL, NULL, NULL, 0);
+
+ return TRUE;
+ }
+
+ memset(&req, 0x0, sizeof(struct treq_phonebook_read_record));
+
+ req.index = (unsigned short)index;
+ req.phonebook_type = req_type;
+
+ dbg("[%s] req phonebook_type[%d][%s] index[%d]", GET_CP_NAME(invocation),
+ req.phonebook_type,
+ dbg_dbus_pb_type_name[req.phonebook_type], req.index);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, phonebook, invocation,
+ TREQ_PHONEBOOK_READRECORD,
+ &req, sizeof(struct treq_phonebook_read_record));
+
+ return TRUE;
+}
+
+static gboolean on_phonebook_update_record(TelephonyPhonebook *phonebook,
+ GDBusMethodInvocation *invocation,
+ gint type, gint index,
+ const gchar *name, gint dcs,
+ const gchar *number, gint ton,
+ const gchar *sne, gint sne_dcs,
+ const gchar *number2, gint number2_ton,
+ const gchar *number3, gint number3_ton,
+ const gchar *number4, gint number4_ton,
+ const gchar *email1, const gchar *email2,
+ const gchar *email3, const gchar *email4,
+ gint group_index, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ struct treq_phonebook_update_record req;
+ CoreObject *co_pb = NULL;
+ gboolean pb_status = FALSE;
+ int temp_len = 0;
+
+ if (!check_access_control(invocation, AC_PHONEBOOK, "x"))
+ return TRUE;
+
+ DBUS_PBM_GET_CO_PBM(invocation, co_pb, ctx->server);
+ pb_status = tcore_phonebook_get_status(co_pb);
+ if (pb_status == FALSE) {
+ dbg("pb_init is not completed yet.");
+
+ telephony_phonebook_complete_update_record(phonebook, invocation,
+ PB_ACCESS_CONDITION_NOT_SATISFIED);
+
+ return TRUE;
+ }
+
+ memset(&req, 0x0, sizeof(struct treq_phonebook_update_record));
+
+ dbg("[%s] pb_type[%d] index[%d] name[%s] number[%s] email[%s]",
+ GET_CP_NAME(invocation), type, index,
+ name, number, email1);
+
+ req.index = (unsigned short)index;
+ req.phonebook_type = type;
+
+ if (name != NULL && strlen(name)) {
+ req.dcs = PB_TEXT_ASCII;
+ req.name_len = strlen(name);
+
+ if (req.name_len > PHONEBOOK_NAME_BYTE_MAX)
+ req.name_len = PHONEBOOK_NAME_BYTE_MAX;
+
+ memcpy(req.name, name, req.name_len);
+ }
+
+ if (sne != NULL && strlen(sne)) {
+ req.sne_dcs = PB_TEXT_ASCII;
+ req.sne_len = strlen(sne);
+
+ if (req.sne_len > PHONEBOOK_NAME_BYTE_MAX)
+ req.sne_len = PHONEBOOK_NAME_BYTE_MAX;
+
+ memcpy(req.sne, sne, req.sne_len);
+ }
+
+ if (number != NULL && (temp_len = strlen(number))) {
+ req.ton = ton;
+
+ if (temp_len > PHONEBOOK_NUMBER_BYTE_MAX)
+ temp_len = PHONEBOOK_NUMBER_BYTE_MAX;
+
+ memcpy(req.number, number, temp_len);
+ }
+
+ if (number2 != NULL && (temp_len = strlen(number2))) {
+ req.anr1_ton = number2_ton;
+
+ if (temp_len > PHONEBOOK_NUMBER_BYTE_MAX)
+ temp_len = PHONEBOOK_NUMBER_BYTE_MAX;
+
+ memcpy(req.anr1, number2, temp_len);
+ }
+
+ if (number3 != NULL && (temp_len = strlen(number3))) {
+ req.anr2_ton = number3_ton;
+
+ if (temp_len > PHONEBOOK_NUMBER_BYTE_MAX)
+ temp_len = PHONEBOOK_NUMBER_BYTE_MAX;
+
+ memcpy(req.anr2, number3, temp_len);
+ }
+
+ if (number4 != NULL && (temp_len = strlen(number4))) {
+ req.anr3_ton = number4_ton;
+
+ if (temp_len > PHONEBOOK_NUMBER_BYTE_MAX)
+ temp_len = PHONEBOOK_NUMBER_BYTE_MAX;
+
+ memcpy(req.anr3, number4, temp_len);
+ }
+
+ if (email1 != NULL && strlen(email1)) {
+ req.email1_len = strlen(email1);
+
+ if (req.email1_len > PHONEBOOK_EMAIL_BYTE_MAX)
+ req.email1_len = PHONEBOOK_EMAIL_BYTE_MAX;
+
+ memcpy(req.email1, email1, req.email1_len);
+ }
+
+ /* Additional e-mail fields (email 2,3,4) cannot be used to CP */
+
+ req.group_index = (unsigned short)group_index;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, phonebook, invocation,
+ TREQ_PHONEBOOK_UPDATERECORD,
+ &req, sizeof(struct treq_phonebook_update_record));
+
+ return TRUE;
+}
+
+static gboolean on_phonebook_delete_record(TelephonyPhonebook *phonebook,
+ GDBusMethodInvocation *invocation,
+ gint type, gint index,
+ gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ struct treq_phonebook_delete_record req;
+ CoreObject *co_pb = NULL;
+ gboolean pb_status = FALSE;
+
+ if (!check_access_control(invocation, AC_PHONEBOOK, "x"))
+ return TRUE;
+
+ DBUS_PBM_GET_CO_PBM(invocation, co_pb, ctx->server);
+ pb_status = tcore_phonebook_get_status(co_pb);
+ if (pb_status == FALSE) {
+ dbg("pb_init is not completed yet.");
+
+ telephony_phonebook_complete_delete_record(phonebook, invocation,
+ PB_ACCESS_CONDITION_NOT_SATISFIED);
+
+ return TRUE;
+ }
+
+ memset(&req, 0x0, sizeof(struct treq_phonebook_delete_record));
+
+ req.index = (unsigned short)index;
+ req.phonebook_type = type;
+
+ dbg("[%s] req phonebook_type[%d][%s] index[%d]", GET_CP_NAME(invocation),
+ req.phonebook_type,
+ dbg_dbus_pb_type_name[req.phonebook_type], req.index);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, phonebook, invocation,
+ TREQ_PHONEBOOK_DELETERECORD,
+ &req, sizeof(struct treq_phonebook_delete_record));
+
+ return TRUE;
+}
+
+gboolean dbus_plugin_setup_phonebook_interface(TelephonyObjectSkeleton *object,
+ struct custom_data *ctx)
+{
+ TelephonyPhonebook *phonebook;
+
+ phonebook = telephony_phonebook_skeleton_new();
+ telephony_object_skeleton_set_phonebook(object, phonebook);
+ g_object_unref(phonebook);
+
+ dbg("phonebook = %p", phonebook);
+
+ /*
+ * Register signal handlers for Phonebook interface
+ */
+ g_signal_connect(phonebook,
+ "handle-get-init-status",
+ G_CALLBACK(on_phonebook_get_init_status), ctx);
+
+ g_signal_connect(phonebook,
+ "handle-get-count",
+ G_CALLBACK(on_phonebook_get_count), ctx);
+
+ g_signal_connect(phonebook,
+ "handle-get-info",
+ G_CALLBACK(on_phonebook_get_info), ctx);
+
+ g_signal_connect(phonebook,
+ "handle-get-usim-meta-info",
+ G_CALLBACK(on_phonebook_get_usim_info), ctx);
+
+ g_signal_connect(phonebook,
+ "handle-read-record",
+ G_CALLBACK(on_phonebook_read_record), ctx);
+
+ g_signal_connect(phonebook,
+ "handle-update-record",
+ G_CALLBACK(on_phonebook_update_record), ctx);
+
+ g_signal_connect(phonebook,
+ "handle-delete-record",
+ G_CALLBACK(on_phonebook_delete_record), ctx);
+
+ return TRUE;
+}
+
+gboolean dbus_plugin_phonebook_response(struct custom_data *ctx,
+ UserRequest *ur, struct dbus_request_info *dbus_info,
+ enum tcore_response_command command, unsigned int data_len, const void *data)
+{
+ const struct tresp_phonebook_get_count *resp_pbcnt = data;
+ const struct tresp_phonebook_get_info *resp_entry = data;
+ const struct tresp_phonebook_get_usim_info *resp_capa = data;
+ const struct tresp_phonebook_read_record *resp_pbread = data;
+ const struct tresp_phonebook_update_record *resp_pbupdate = data;
+ const struct tresp_phonebook_delete_record *resp_pbdelete = data;
+ char *cpname = dbus_info ? GET_CP_NAME(dbus_info->invocation) : "";
+
+ switch (command) {
+ case TRESP_PHONEBOOK_GETCOUNT:
+ dbg("[%s] GETCOUNT (type[%d][%s] used[%d]total[%d])",
+ cpname, resp_pbcnt->type, dbg_dbus_pb_type_name[resp_pbcnt->type],
+ resp_pbcnt->used_count, resp_pbcnt->total_count);
+
+ telephony_phonebook_complete_get_count(dbus_info->interface_object, dbus_info->invocation,
+ resp_pbcnt->result, resp_pbcnt->type, resp_pbcnt->used_count, resp_pbcnt->total_count);
+ break;
+
+ case TRESP_PHONEBOOK_GETMETAINFO:
+ dbg("[%s] GETMETAINFO (type[%d][%s])",
+ cpname, resp_entry->type, dbg_dbus_pb_type_name[resp_entry->type]);
+ dbg("index(min[%d]max[%d]), num_max[%d] text(max[%d]used[%d])",
+ resp_entry->index_min, resp_entry->index_max, resp_entry->number_length_max,
+ resp_entry->text_length_max, resp_entry->used_count);
+
+ telephony_phonebook_complete_get_info(dbus_info->interface_object, dbus_info->invocation,
+ resp_entry->result, resp_entry->type, resp_entry->index_min, resp_entry->index_max,
+ resp_entry->number_length_max, resp_entry->text_length_max, resp_entry->used_count);
+ break;
+
+ case TRESP_PHONEBOOK_GETUSIMINFO: {
+ GVariant *gv = NULL;
+ GVariantBuilder b;
+ int i;
+
+ dbg("[%s] GETUSIMINFO", cpname);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+ for (i = 0; i < resp_capa->field_count; i++) {
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+ dbg("type[%d][%s] index_max[%d] text_max[%d] used_count[%d]",
+ resp_capa->field_list[i].field,
+ dbg_dbus_pb_adf_field_name[resp_capa->field_list[i].field],
+ resp_capa->field_list[i].index_max,
+ resp_capa->field_list[i].text_max,
+ resp_capa->field_list[i].used_count);
+ g_variant_builder_add(&b, "{sv}", "field_type", g_variant_new_int32(resp_capa->field_list[i].field));
+ g_variant_builder_add(&b, "{sv}", "index_max", g_variant_new_int32(resp_capa->field_list[i].index_max));
+ g_variant_builder_add(&b, "{sv}", "text_max", g_variant_new_int32(resp_capa->field_list[i].text_max));
+ g_variant_builder_add(&b, "{sv}", "used_count", g_variant_new_int32(resp_capa->field_list[i].used_count));
+ g_variant_builder_close(&b);
+ }
+ gv = g_variant_builder_end(&b);
+
+ telephony_phonebook_complete_get_usim_meta_info(dbus_info->interface_object,
+ dbus_info->invocation, resp_capa->result, gv);
+ }
+ break;
+
+ case TRESP_PHONEBOOK_READRECORD: {
+ unsigned char dest_pb_name[PHONEBOOK_NAME_BYTE_MAX + 1];
+ unsigned char dest_pb_sne[PHONEBOOK_NAME_BYTE_MAX + 1];
+ unsigned char dest_pb_email1[PHONEBOOK_EMAIL_BYTE_MAX + 1];
+ memset(dest_pb_name, 0x00, PHONEBOOK_NAME_BYTE_MAX + 1);
+ memset(dest_pb_sne, 0x00, PHONEBOOK_NAME_BYTE_MAX + 1);
+ memset(dest_pb_email1, 0x00, PHONEBOOK_EMAIL_BYTE_MAX + 1);
+ /* Additional e-mail fields (email 2,3,4) cannot be used to CP*/
+
+ dbg("[%s] READRECORD (type[%d][%s] index[%d][%d])",
+ cpname, resp_pbread->phonebook_type,
+ dbg_dbus_pb_type_name[resp_pbread->phonebook_type],
+ resp_pbread->index, resp_pbread->next_index);
+
+ if (resp_pbread->name_len > 0) {
+ dbg("name:[%s] len:[%d]", resp_pbread->name, resp_pbread->name_len);
+ memcpy(dest_pb_name, resp_pbread->name, resp_pbread->name_len);
+ }
+
+ dbg("number:[%s] ton:[%d][%s])",
+ resp_pbread->number, resp_pbread->ton, dbg_dbus_pb_ton_name[resp_pbread->ton]);
+
+ if (resp_pbread->phonebook_type == PB_TYPE_USIM) {
+ if (resp_pbread->sne_len > 0) {
+ dbg("sne:[%s] sne_len:[%d]", resp_pbread->sne, resp_pbread->sne_len);
+ memcpy(dest_pb_sne, resp_pbread->sne, resp_pbread->sne_len);
+ }
+
+ if (strlen((const char*)resp_pbread->anr1) != 0
+ || strlen((const char*)resp_pbread->anr2) != 0
+ || strlen((const char*)resp_pbread->anr3) != 0) {
+ dbg("anr1:([%s],ton[%d][%s])", resp_pbread->anr1,
+ resp_pbread->anr1_ton, dbg_dbus_pb_ton_name[resp_pbread->anr1_ton]);
+ dbg("anr2:([%s],ton[%d][%s])", resp_pbread->anr2,
+ resp_pbread->anr2_ton, dbg_dbus_pb_ton_name[resp_pbread->anr2_ton]);
+ dbg("anr3:([%s],ton[%d][%s])", resp_pbread->anr3,
+ resp_pbread->anr3_ton, dbg_dbus_pb_ton_name[resp_pbread->anr3_ton]);
+ }
+
+ if (resp_pbread->email1_len > 0) {
+ dbg("email1:[%s] len:[%d]", resp_pbread->email1, resp_pbread->email1_len);
+ memcpy(dest_pb_email1, resp_pbread->email1, resp_pbread->email1_len);
+ }
+
+ /* Additional e-mail fields (email 2,3,4) cannot be used to CP*/
+ }
+
+ /*
+ * Check whether NAME, SNE string values are invalid utf-8 string or not,
+ * because if invalid it will be converted to "[INVALID UTF-8]" automatically by g_variant_new_string().
+ */
+ if (g_utf8_validate((const gchar *)dest_pb_name, -1, NULL) == FALSE) {
+ tcore_util_hex_dump("[INVALID_UTF8_NAME] ", strlen((const char*)dest_pb_name), dest_pb_name);
+ dbg("Empty NAME field.");
+ memset(dest_pb_name, 0x00, PHONEBOOK_NAME_BYTE_MAX + 1);
+ }
+ if (resp_pbread->phonebook_type == PB_TYPE_USIM) {
+ if (g_utf8_validate((const gchar *)dest_pb_sne, -1, NULL) == FALSE) {
+ tcore_util_hex_dump("[INVALID_UTF8_SNE] ", strlen((const char*)dest_pb_sne), dest_pb_sne);
+ dbg("Empty SNE field.");
+ memset(dest_pb_sne, 0x00, PHONEBOOK_NAME_BYTE_MAX + 1);
+ }
+ }
+
+ telephony_phonebook_complete_read_record(dbus_info->interface_object, dbus_info->invocation,
+ resp_pbread->result, resp_pbread->phonebook_type, resp_pbread->index, resp_pbread->next_index,
+ (const gchar *)dest_pb_name, resp_pbread->dcs,
+ (const gchar *)resp_pbread->number, resp_pbread->ton,
+ (const gchar *)dest_pb_sne, resp_pbread->sne_dcs,
+ (const gchar *)resp_pbread->anr1, resp_pbread->anr1_ton,
+ (const gchar *)resp_pbread->anr2, resp_pbread->anr2_ton,
+ (const gchar *)resp_pbread->anr3, resp_pbread->anr3_ton,
+ (const gchar *)dest_pb_email1,
+ (const gchar *)resp_pbread->email2,
+ (const gchar *)resp_pbread->email3,
+ (const gchar *)resp_pbread->email4,
+ resp_pbread->group_index);
+ }
+ break;
+
+ case TRESP_PHONEBOOK_UPDATERECORD:
+ dbg("[%s] UPDATERECORD (result[%d])", cpname, resp_pbupdate->result);
+
+ telephony_phonebook_complete_update_record(dbus_info->interface_object,
+ dbus_info->invocation, resp_pbupdate->result);
+ break;
+
+ case TRESP_PHONEBOOK_DELETERECORD:
+ dbg("[%s] DELETERECORD (result[%d])", cpname, resp_pbdelete->result);
+
+ telephony_phonebook_complete_delete_record(dbus_info->interface_object,
+ dbus_info->invocation, resp_pbdelete->result);
+ break;
+
+ default:
+ err("Unhandled/Unknown Response: [0x%x]", command);
+ break;
+ }
+
+ return TRUE;
+}
+
+gboolean dbus_plugin_phonebook_notification(struct custom_data *ctx,
+ CoreObject *source, TelephonyObjectSkeleton *object,
+ enum tcore_notification_command command, unsigned int data_len, const void *data)
+{
+ TelephonyPhonebook *phonebook;
+ const char *cp_name;
+
+ cp_name = tcore_server_get_cp_name_by_plugin(tcore_object_ref_plugin(source));
+
+ phonebook = telephony_object_peek_phonebook(TELEPHONY_OBJECT(object));
+ if (phonebook == NULL) {
+ err("phonebook object is NULL!!!");
+ return FALSE;
+ }
+
+ switch (command) {
+ case TNOTI_PHONEBOOK_STATUS: {
+ const struct tnoti_phonebook_status *n_pb_status = data;
+
+#ifdef ENABLE_KPI_LOGS
+ if (n_pb_status->b_init == TRUE)
+ TIME_CHECK("[%s] PBM Service Ready", cp_name);
+#endif
+
+ telephony_phonebook_emit_status(phonebook,
+ n_pb_status->b_init,
+ n_pb_status->support_list.b_fdn,
+ n_pb_status->support_list.b_adn,
+ n_pb_status->support_list.b_sdn,
+ n_pb_status->support_list.b_usim,
+ n_pb_status->support_list.b_aas,
+ n_pb_status->support_list.b_gas);
+ }
+ break;
+
+ case TNOTI_PHONEBOOK_CONTACT_CHANGE: {
+ const struct tnoti_phonebook_contact_change *n_pb_contact_change = data;
+
+ dbg("phonebook_type [%d] index [%d] operation [%d]",
+ n_pb_contact_change->phonebook_type,
+ n_pb_contact_change->index, n_pb_contact_change->operation);
+
+ telephony_phonebook_emit_contact_change(phonebook,
+ n_pb_contact_change->phonebook_type,
+ n_pb_contact_change->index,
+ n_pb_contact_change->operation);
+ }
+ break;
+
+ default:
+ err("Unhandled/Unknown Notification: [0x%x]", command);
+ break;
+ }
+
+ return TRUE;
+}
--- /dev/null
+/*
+ * tel-plugin-dbus-tapi
+ *
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Ja-young Gu <jygu@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <tcore.h>
+#include <plugin.h>
+
+#include "generated-code.h"
+#include "dtapi_common.h"
+
+static gboolean on_sap_connect(TelephonySap *sap,
+ GDBusMethodInvocation *invocation, gint req_max_size, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ struct treq_sap_req_connect req;
+
+ if (!check_access_control(invocation, AC_SAP, "x"))
+ return TRUE;
+
+ memset(&req, 0x0, sizeof(struct treq_sap_req_connect));
+
+ req.max_msg_size = (unsigned short)req_max_size;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sap, invocation,
+ TREQ_SAP_REQ_CONNECT,
+ &req, sizeof(struct treq_sap_req_connect));
+
+ return TRUE;
+}
+
+static gboolean on_sap_disconnect(TelephonySap *sap,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_SAP, "x"))
+ return TRUE;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sap, invocation,
+ TREQ_SAP_REQ_DISCONNECT,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_sap_get_status(TelephonySap *sap,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_SAP, "r"))
+ return TRUE;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sap, invocation,
+ TREQ_SAP_REQ_STATUS,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_sap_get_atr(TelephonySap *sap,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_SAP, "r"))
+ return TRUE;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sap, invocation,
+ TREQ_SAP_REQ_ATR,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_sap_transfer_apdu(TelephonySap *sap,
+ GDBusMethodInvocation *invocation, GVariant *req_apdu, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ struct treq_sap_transfer_apdu req;
+ GVariantIter *iter = NULL;
+ GVariant *inner_gv = NULL;
+ guchar rt_i;
+ int i = 0;
+
+ dbg("Func Entrance");
+
+ if (!check_access_control(invocation, AC_SAP, "x"))
+ return TRUE;
+
+ memset(&req, 0x0, sizeof(struct treq_sap_transfer_apdu));
+
+ inner_gv = g_variant_get_variant(req_apdu);
+
+ g_variant_get(inner_gv, "ay", &iter);
+ while (g_variant_iter_loop(iter, "y", &rt_i)) {
+ req.apdu_data[i] = rt_i;
+ i++;
+ }
+
+ req.apdu_length = (unsigned int)i;
+ g_variant_iter_free(iter);
+ g_variant_unref(inner_gv);
+ g_variant_unref(req_apdu);
+
+ for (i = 0; i < (int)req.apdu_length; i++)
+ dbg("apdu[%d][0x%02x]", i, req.apdu_data[i]);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sap, invocation,
+ TREQ_SAP_TRANSFER_APDU,
+ &req, sizeof(struct treq_sap_transfer_apdu));
+
+ return TRUE;
+}
+
+static gboolean on_sap_set_protocol(TelephonySap *sap,
+ GDBusMethodInvocation *invocation, gint protocol, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ struct treq_sap_set_protocol req;
+
+ if (!check_access_control(invocation, AC_SAP, "w"))
+ return TRUE;
+
+ memset(&req, 0x0, sizeof(struct treq_sap_set_protocol));
+
+ req.protocol = protocol;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sap, invocation,
+ TREQ_SAP_SET_PROTOCOL,
+ &req, sizeof(struct treq_sap_set_protocol));
+
+ return TRUE;
+}
+
+static gboolean on_sap_set_power(TelephonySap *sap,
+ GDBusMethodInvocation *invocation, gint mode, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ struct treq_sap_set_power req;
+
+ if (!check_access_control(invocation, AC_SAP, "w"))
+ return TRUE;
+
+ memset(&req, 0x0, sizeof(struct treq_sap_set_power));
+
+ req.mode = mode;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sap, invocation,
+ TREQ_SAP_SET_POWER,
+ &req, sizeof(struct treq_sap_set_power));
+
+ return TRUE;
+}
+
+static gboolean on_sap_get_card_reader_status(TelephonySap *sap,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_SAP, "r"))
+ return TRUE;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sap, invocation,
+ TREQ_SAP_REQ_CARDREADERSTATUS,
+ NULL, 0);
+
+ return TRUE;
+}
+
+gboolean dbus_plugin_setup_sap_interface(TelephonyObjectSkeleton *object,
+ struct custom_data *ctx)
+{
+ TelephonySap *sap;
+
+ sap = telephony_sap_skeleton_new();
+ telephony_object_skeleton_set_sap(object, sap);
+ g_object_unref(sap);
+
+ dbg("sap = %p", sap);
+
+ /*
+ * Register signal handlers for SAP interface
+ */
+ g_signal_connect(sap,
+ "handle-connect",
+ G_CALLBACK(on_sap_connect), ctx);
+
+ g_signal_connect(sap,
+ "handle-disconnect",
+ G_CALLBACK(on_sap_disconnect), ctx);
+
+ g_signal_connect(sap,
+ "handle-get-status",
+ G_CALLBACK(on_sap_get_status), ctx);
+
+ g_signal_connect(sap,
+ "handle-get-atr",
+ G_CALLBACK(on_sap_get_atr), ctx);
+
+ g_signal_connect(sap,
+ "handle-transfer-apdu",
+ G_CALLBACK(on_sap_transfer_apdu), ctx);
+
+ g_signal_connect(sap,
+ "handle-set-protocol",
+ G_CALLBACK(on_sap_set_protocol), ctx);
+
+ g_signal_connect(sap,
+ "handle-set-power",
+ G_CALLBACK(on_sap_set_power), ctx);
+
+ g_signal_connect(sap,
+ "handle-get-card-reader-status",
+ G_CALLBACK(on_sap_get_card_reader_status), ctx);
+
+ return TRUE;
+}
+
+gboolean dbus_plugin_sap_response(struct custom_data *ctx,
+ UserRequest *ur, struct dbus_request_info *dbus_info,
+ enum tcore_response_command command, unsigned int data_len, const void *data)
+{
+ switch (command) {
+ case TRESP_SAP_REQ_CONNECT: {
+ const struct tresp_sap_req_connect *sap_conn = data;
+
+ dbg("dbus comm - TRESP_SAP_REQ_CONNECT");
+
+ telephony_sap_complete_connect(dbus_info->interface_object,
+ dbus_info->invocation, sap_conn->status,
+ sap_conn->max_msg_size);
+ }
+ break;
+
+ case TRESP_SAP_REQ_DISCONNECT: {
+ const struct tresp_sap_req_disconnect *sap_disconn = data;
+
+ dbg("dbus comm - TRESP_SAP_REQ_DISCONNECT");
+
+ telephony_sap_complete_disconnect(dbus_info->interface_object,
+ dbus_info->invocation, sap_disconn->result);
+ }
+ break;
+
+ case TRESP_SAP_REQ_STATUS: {
+ const struct tresp_sap_req_status *sap_status = data;
+
+ dbg("dbus comm - TRESP_SAP_REQ_STATUS");
+
+ telephony_sap_complete_get_status(dbus_info->interface_object,
+ dbus_info->invocation, sap_status->status);
+ }
+ break;
+
+ case TRESP_SAP_REQ_ATR: {
+ const struct tresp_sap_req_atr *sap_atr = data;
+ GVariantBuilder builder;
+ GVariant * atr_gv = NULL;
+ GVariant *inner_gv = NULL;
+ int i = 0;
+
+ dbg("dbus comm - TRESP_SAP_REQ_ATR");
+
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("ay"));
+ for (i = 0; i < (int)sap_atr->atr_length; i++) {
+ dbg("sap_atr->atr[%d][0x%02x]", i, sap_atr->atr[i]);
+ g_variant_builder_add(&builder, "y", sap_atr->atr[i]);
+ }
+ inner_gv = g_variant_builder_end(&builder);
+ atr_gv = g_variant_new("v", inner_gv);
+
+ telephony_sap_complete_get_atr(dbus_info->interface_object,
+ dbus_info->invocation, sap_atr->result,
+ atr_gv);
+ }
+ break;
+
+ case TRESP_SAP_TRANSFER_APDU: {
+ const struct tresp_sap_transfer_apdu *sap_apdu = data;
+ GVariantBuilder builder;
+ GVariant * apdu_gv = NULL;
+ GVariant *inner_gv = NULL;
+ int i = 0;
+
+ dbg("dbus comm - TRESP_SAP_TRANSFER_APDU");
+
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("ay"));
+ for (i = 0; i < (int)sap_apdu->resp_apdu_length; i++) {
+ dbg("sap_apdu->resp_adpdu[%d][0x%02x]", i, sap_apdu->resp_adpdu[i]);
+ g_variant_builder_add(&builder, "y", sap_apdu->resp_adpdu[i]);
+ }
+ inner_gv = g_variant_builder_end(&builder);
+ apdu_gv = g_variant_new("v", inner_gv);
+
+ telephony_sap_complete_transfer_apdu(dbus_info->interface_object,
+ dbus_info->invocation, sap_apdu->result,
+ apdu_gv);
+ }
+ break;
+
+ case TRESP_SAP_SET_PROTOCOL: {
+ const struct tresp_sap_set_protocol *sap_protocol = data;
+
+ dbg("dbus comm - TRESP_SAP_SET_PROTOCOL");
+
+ telephony_sap_complete_set_protocol(dbus_info->interface_object,
+ dbus_info->invocation, sap_protocol->result);
+ }
+ break;
+
+ case TRESP_SAP_SET_POWER: {
+ const struct tresp_sap_set_power *sap_power = data;
+
+ dbg("dbus comm - TRESP_SAP_SET_POWER");
+
+ telephony_sap_complete_set_power(dbus_info->interface_object,
+ dbus_info->invocation, sap_power->result);
+ }
+ break;
+
+ case TRESP_SAP_REQ_CARDREADERSTATUS: {
+ const struct tresp_sap_req_cardreaderstatus *sap_reader = data;
+
+ dbg("dbus comm - TRESP_SAP_REQ_CARDREADERSTATUS");
+
+ telephony_sap_complete_get_card_reader_status(dbus_info->interface_object,
+ dbus_info->invocation, sap_reader->result,
+ sap_reader->reader_status);
+ }
+ break;
+
+ default:
+ err("Unhandled/Unknown Response: [0x%x]", command);
+ break;
+ }
+
+ return TRUE;
+}
+
+gboolean dbus_plugin_sap_notification(struct custom_data *ctx,
+ CoreObject *source, TelephonyObjectSkeleton *object,
+ enum tcore_notification_command command, unsigned int data_len, const void *data)
+{
+ TelephonySap *sap;
+
+ if (!object) {
+ err("object is NULL");
+ return FALSE;
+ }
+
+ sap = telephony_object_peek_sap(TELEPHONY_OBJECT(object));
+ if (sap == NULL) {
+ err("sap object is NULL!!!");
+ return FALSE;
+ }
+
+ switch (command) {
+ case TNOTI_SAP_STATUS: {
+ const struct tnoti_sap_status_changed *sap_status = data;
+
+ dbg("notified sap_status[%d]", sap_status->status);
+
+ telephony_sap_emit_status(sap, sap_status->status);
+ }
+ break;
+
+ case TNOTI_SAP_DISCONNECT: {
+ const struct tnoti_sap_disconnect *sap_disconn = data;
+
+ dbg("notified sap_disconnect type[%d]", sap_disconn->type);
+
+ telephony_sap_emit_disconnect(sap, sap_disconn->type);
+ }
+ break;
+
+ default:
+ err("Unhandled/Unknown Notification: [0x%x]", command);
+ break;
+ }
+
+ return TRUE;
+}
--- /dev/null
+/*
+ * tel-plugin-dbus
+ *
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Ja-young Gu <jygu@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <glib.h>
+
+#include <tcore.h>
+#include <server.h>
+#include <plugin.h>
+#include <co_sat.h>
+
+#include "generated-code.h"
+#include "dtapi_common.h"
+#include "dtapi_sat_manager.h"
+#include "sat_ui_support/sat_ui_support.h"
+
+static void __sat_set_main_menu(struct custom_data *ctx,
+ const char *cp_name, GVariant *main_menu)
+{
+ GSList *list = NULL;
+ struct cached_data *object = NULL;
+
+ for (list = ctx->cached_data; list; list = list->next) {
+ object = (struct cached_data *)list->data;
+ if (object && g_strcmp0(object->cp_name, cp_name) == 0) {
+ /*
+ * Need to free the previous main_menu
+ */
+ g_variant_unref(object->cached_sat_main_menu);
+ object->cached_sat_main_menu = main_menu;
+
+ return;
+ }
+ }
+
+ /*
+ * If 'object' is NOT created,
+ * then create the object and add to the list
+ */
+ object = g_try_malloc0(sizeof(struct cached_data));
+ if (NULL == object) {
+ err("Memory allocation failed");
+ return;
+ }
+
+ object->cp_name = g_strdup(cp_name);
+ object->cached_sat_main_menu = main_menu;
+
+ /*
+ * Append the new 'object' to cached data list
+ */
+ ctx->cached_data = g_slist_append(ctx->cached_data, (gpointer)object);
+}
+
+static GVariant *__sat_get_main_menu(struct custom_data *ctx,
+ const char *cp_name)
+{
+ GSList *list = NULL;
+ struct cached_data *object;
+
+ /*
+ * List of Objects in 'ctx',
+ * compare cp_name with modem_name stored in 'ctx'
+ * if matching return main_menu of that object.
+ */
+ for (list = ctx->cached_data; list; list = list->next) {
+ object = (struct cached_data *)list->data;
+ if (object && g_strcmp0(object->cp_name, cp_name) == 0)
+ return object->cached_sat_main_menu;
+ }
+
+ return NULL;
+}
+
+static gboolean on_sat_get_main_menu_info(TelephonySAT *sat,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ GVariant *main_menu = NULL;
+
+ gchar *title;
+ gint result = 1, command_id, item_cnt;
+ gboolean b_present, b_help_info, b_updated;
+ GVariant *items;
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ GVariant *icon_id = NULL;
+ GVariant *icon_list = NULL;
+#endif
+
+ if (!check_access_control(invocation, AC_SAT, "r"))
+ return TRUE;
+
+ main_menu = __sat_get_main_menu(ctx, GET_CP_NAME(invocation));
+ if (!main_menu) {
+ err("NO Main Menu");
+ FAIL_RESPONSE(invocation, DEFAULT_MSG_REQ_FAILED);
+ return TRUE;
+ }
+
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ g_variant_get(main_menu, "(ibs@vibb@v@v)", &command_id,
+ &b_present, &title, &items, &item_cnt,
+ &b_help_info, &b_updated, &icon_id, &icon_list);
+
+ telephony_sat_complete_get_main_menu_info(sat, invocation,
+ result, command_id, b_present, title,
+ items, item_cnt, b_help_info, b_updated, icon_id, icon_list);
+#else
+ g_variant_get(main_menu, "(ibs@vibb)", &command_id,
+ &b_present, &title, &items, &item_cnt,
+ &b_help_info, &b_updated);
+
+ telephony_sat_complete_get_main_menu_info(sat, invocation,
+ result, command_id, b_present, title,
+ items, item_cnt, b_help_info, b_updated);
+#endif
+
+ g_free(title);
+
+ return TRUE;
+}
+
+static gboolean on_sat_send_display_status(TelephonySAT *sat,
+ GDBusMethodInvocation *invocation,
+ gint command_id, gboolean display_status, gpointer user_data)
+{
+ TcorePlugin *plg = NULL;
+ char *cp_name;
+ struct custom_data *ctx = user_data;
+ gboolean result = FALSE;
+ gint out_param = 0;
+
+ if (!check_access_control(invocation, AC_SAT, "x"))
+ return TRUE;
+
+ cp_name = GET_CP_NAME(invocation);
+ plg = tcore_server_find_plugin(ctx->server, cp_name);
+ if (!plg) {
+ dbg("There is NO valid plugin at this point");
+
+ telephony_sat_complete_send_ui_display_status(sat,
+ invocation, out_param);
+
+ return TRUE;
+ }
+
+ result = sat_manager_handle_ui_display_status(ctx, plg,
+ command_id, display_status);
+ if (!result)
+ dbg("Failed to send 'exec' result");
+
+ out_param = (result ? 1 : 0);
+ telephony_sat_complete_send_ui_display_status(sat,
+ invocation, out_param);
+
+ return TRUE;
+}
+
+static gboolean on_sat_send_user_confirm(TelephonySAT *sat,
+ GDBusMethodInvocation *invocation,
+ gint command_id, gint command_type, gint user_confirm_type,
+ GVariant *additional_data, gpointer user_data)
+{
+ TcorePlugin *plg = NULL;
+ char *cp_name;
+ struct custom_data *ctx = user_data;
+
+ gboolean result = FALSE;
+ gint out_param = 0;
+ GVariant *confirm_data = NULL;
+
+ if (!check_access_control(invocation, AC_SAT, "x"))
+ return TRUE;
+
+ cp_name = GET_CP_NAME(invocation);
+ plg = tcore_server_find_plugin(ctx->server, cp_name);
+ if (!plg) {
+ dbg("There is NO valid plugin at this point");
+
+ telephony_sat_complete_send_user_confirm(sat,
+ invocation, out_param);
+
+ return TRUE;
+ }
+
+ confirm_data = g_variant_new("(iiv)", command_id,
+ user_confirm_type, additional_data);
+
+ result = sat_manager_handle_user_confirm(ctx,
+ plg, confirm_data);
+ if (!result)
+ dbg("Failed to send 'user confirm'");
+
+ out_param = (result ? 1 : 0);
+ telephony_sat_complete_send_user_confirm(sat,
+ invocation, out_param);
+
+ return TRUE;
+}
+
+static gboolean on_sat_send_app_exec_result(TelephonySAT *sat,
+ GDBusMethodInvocation *invocation,
+ gint command_id, gint command_type,
+ GVariant *exec_result, gpointer user_data)
+{
+ TcorePlugin *plg = NULL;
+ char *cp_name;
+ struct custom_data *ctx = user_data;
+
+ gboolean result = FALSE;
+ gint out_param = 0;
+
+ if (!check_access_control(invocation, AC_SAT, "x"))
+ return TRUE;
+
+ cp_name = GET_CP_NAME(invocation);
+ plg = tcore_server_find_plugin(ctx->server, cp_name);
+ if (!plg) {
+ dbg("There is NO valid plugin at this point");
+
+ telephony_sat_complete_send_app_exec_result(sat,
+ invocation, out_param);
+
+ return TRUE;
+ }
+
+ dbg("Processing app 'exec' result");
+ result = sat_manager_handle_app_exec_result(ctx, plg,
+ command_id, command_type, exec_result);
+ if (!result)
+ dbg("Failed to send 'exec' result");
+
+ out_param = (result ? 1 : 0);
+ telephony_sat_complete_send_app_exec_result(sat,
+ invocation, out_param);
+
+ return TRUE;
+}
+
+static gboolean on_sat_select_menu(TelephonySAT *sat,
+ GDBusMethodInvocation *invocation,
+ guchar item_identifier, gboolean help_request, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ struct treq_sat_envelop_cmd_data req;
+
+ if (!check_access_control(invocation, AC_SAT, "x"))
+ return TRUE;
+
+ memset(&req, 0x0, sizeof(struct treq_sat_envelop_cmd_data));
+
+ req.sub_cmd = ENVELOP_MENU_SELECTION;
+ req.envelop_data.menu_select.device_identitie.src = DEVICE_ID_KEYPAD;
+ req.envelop_data.menu_select.device_identitie.dest = DEVICE_ID_SIM;
+ req.envelop_data.menu_select.item_identifier.item_identifier = item_identifier;
+ req.envelop_data.menu_select.help_request = help_request;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sat, invocation,
+ TREQ_SAT_REQ_ENVELOPE,
+ &req, sizeof(struct treq_sat_envelop_cmd_data));
+
+ return TRUE;
+}
+
+static gboolean on_sat_download_event(TelephonySAT *sat,
+ GDBusMethodInvocation *invocation,
+ gint event_download_type, gint src_device, gint dest_device,
+ GVariant *download_data, gpointer user_data)
+{
+ gboolean b_event = FALSE;
+ struct custom_data *ctx = user_data;
+
+ struct treq_sat_envelop_cmd_data req;
+
+ if (!check_access_control(invocation, AC_SAT, "x"))
+ return TRUE;
+
+ memset(&req, 0x0, sizeof(struct treq_sat_envelop_cmd_data));
+
+ req.sub_cmd = ENVELOP_EVENT_DOWNLOAD;
+ req.envelop_data.event_download.event = event_download_type;
+
+ b_event = sat_manager_handle_event_download_envelop(event_download_type,
+ src_device, dest_device,
+ &req.envelop_data.event_download, download_data);
+ if (!b_event) {
+ err("Envelop failed");
+
+ telephony_sat_complete_download_event(sat,
+ invocation, -1, ENVELOPE_FAILED);
+
+ return TRUE;
+ }
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sat, invocation,
+ TREQ_SAT_REQ_ENVELOPE,
+ &req, sizeof(struct treq_sat_envelop_cmd_data));
+
+ return TRUE;
+}
+
+gboolean dbus_plugin_setup_sat_interface(TelephonyObjectSkeleton *object,
+ struct custom_data *ctx)
+{
+ TelephonySAT *sat;
+
+ sat = telephony_sat_skeleton_new();
+ telephony_object_skeleton_set_sat(object, sat);
+ g_object_unref(sat);
+
+ dbg("sat = %p", sat);
+
+ /*
+ * Register signal handlers for SAT interface
+ */
+ g_signal_connect(sat,
+ "handle-get-main-menu-info",
+ G_CALLBACK(on_sat_get_main_menu_info), ctx);
+
+ g_signal_connect(sat,
+ "handle-send-ui-display-status",
+ G_CALLBACK(on_sat_send_display_status), ctx);
+
+ g_signal_connect(sat,
+ "handle-send-user-confirm",
+ G_CALLBACK(on_sat_send_user_confirm), ctx);
+
+ g_signal_connect(sat,
+ "handle-send-app-exec-result",
+ G_CALLBACK(on_sat_send_app_exec_result), ctx);
+
+ g_signal_connect(sat,
+ "handle-select-menu",
+ G_CALLBACK(on_sat_select_menu), ctx);
+
+ g_signal_connect(sat,
+ "handle-download-event",
+ G_CALLBACK(on_sat_download_event), ctx);
+
+ return TRUE;
+}
+
+gboolean dbus_plugin_sat_response(struct custom_data *ctx,
+ UserRequest *ur, struct dbus_request_info *dbus_info,
+ enum tcore_response_command command, unsigned int data_len, const void *data)
+{
+ const struct tresp_sat_envelop_data *envelop_rsp = NULL;
+
+ switch (command) {
+ case TRESP_SAT_REQ_ENVELOPE: {
+ envelop_rsp = (struct tresp_sat_envelop_data *)data;
+
+ dbg("SAT_REQ_ENVELOPE - Result: [%d] Envelop sub-cmd: [%s] Envelop response: [%s]",
+ envelop_rsp->result,
+ (envelop_rsp->sub_cmd == ENVELOP_MENU_SELECTION ? "MENU SELECTION" :
+ (envelop_rsp->sub_cmd == ENVELOP_EVENT_DOWNLOAD ? "EVENT DOWNLOAD" :
+ "UNKNOWN")),
+ (envelop_rsp->envelop_resp == ENVELOPE_SUCCESS ? "Success" :
+ (envelop_rsp->envelop_resp == ENVELOPE_SIM_BUSY? "SIM Busy" :
+ "Fail")));
+
+ if (envelop_rsp->sub_cmd == ENVELOP_MENU_SELECTION)
+ telephony_sat_complete_select_menu(dbus_info->interface_object,
+ dbus_info->invocation, envelop_rsp->result,
+ envelop_rsp->envelop_resp);
+ else if (envelop_rsp->sub_cmd == ENVELOP_EVENT_DOWNLOAD)
+ telephony_sat_complete_download_event(dbus_info->interface_object,
+ dbus_info->invocation, envelop_rsp->result,
+ envelop_rsp->envelop_resp);
+ }
+ break;
+
+ case TRESP_SAT_REQ_TERMINALRESPONSE:
+ dbg("SAT_REQ_TERMINALRESPONSE");
+ break;
+
+ default:
+ err("Unhandled/Unknown Response: [0x%x]", command);
+ break;
+ }
+
+ return TRUE;
+}
+
+gboolean dbus_plugin_sat_notification(struct custom_data *ctx,
+ CoreObject *source, TelephonyObjectSkeleton *object,
+ enum tcore_notification_command command, unsigned int data_len, const void *data)
+{
+ TelephonySAT *sat;
+ const char *cp_name;
+ enum dbus_tapi_sim_slot_id slot_id;
+
+ if (!object || !ctx) {
+ err("NULL data is detected!!");
+ return FALSE;
+ }
+
+ cp_name = tcore_server_get_cp_name_by_plugin(tcore_object_ref_plugin(source));
+ slot_id = get_sim_slot_id_by_cp_name(cp_name);
+ dbg("Slot ID: [%d]", slot_id);
+
+ sat = telephony_object_peek_sat(TELEPHONY_OBJECT(object));
+ if (sat == NULL) {
+ err("sat object is NULL!!!");
+ return FALSE;
+ }
+
+ switch (command) {
+ case TNOTI_SAT_SESSION_END: { /* Session End notification */
+ dbg("[%s] SAT_SESSION_END", cp_name);
+
+ sat_manager_init_queue(ctx, cp_name);
+
+ /* sat_ui_support_terminate_sat_ui(); */
+ telephony_sat_emit_end_proactive_session(sat,
+ SAT_PROATV_CMD_TYPE_END_PROACTIVE_SESSION);
+ }
+ break;
+
+ case TNOTI_SAT_CALL_CTRL_RESULT: { /* Call Control notification */
+ struct tnoti_sat_call_control_result_ind *cc_result_noti = NULL;
+ gint call_ctrl_result = 0, bc_repeat_indicator = 0, ton = 0x0F, npi = 0X0F;
+ gchar *text = NULL, *call_num = NULL, *ss_string = NULL, *sub_addr = NULL;
+ gchar *ccp1 = NULL, *ccp2 = NULL;
+
+ cc_result_noti = (struct tnoti_sat_call_control_result_ind *)data;
+ if (cc_result_noti == NULL) {
+ err("Indication data is NULL");
+ return FALSE;
+ }
+
+ dbg("[%s] SAT_CALL_CTRL_RESULT - Result: [%s]", cp_name,
+ (cc_result_noti->cc_result == call_control_allowed_no_mod ? "No Modification" :
+ (cc_result_noti->cc_result == call_control_allowed_with_mod ? "Allowed Modification" :
+ "NOT Allowed")));
+
+ call_ctrl_result = cc_result_noti->cc_result;
+ bc_repeat_indicator = cc_result_noti->bc_repeat_type.bc_indi_repeat_type;
+
+ if (cc_result_noti->address.dialing_number_len > 0) {
+ ton = cc_result_noti->address.ton;
+ npi = cc_result_noti->address.npi;
+ if (ton == TON_INTERNATIONAL)
+ call_num = g_strdup_printf("+%s", cc_result_noti->address.dialing_number);
+ else
+ call_num = g_strdup(cc_result_noti->address.dialing_number);
+ ss_string = g_strdup("");
+ } else if (cc_result_noti->ss_string.string_len > 0) {
+ ton = cc_result_noti->ss_string.ton;
+ npi = cc_result_noti->ss_string.npi;
+ call_num = g_strdup("");
+ ss_string = g_strdup(cc_result_noti->ss_string.ss_string);
+ }
+
+ if (cc_result_noti->alpha_id.alpha_data_len > 0)
+ text = g_strdup(cc_result_noti->alpha_id.alpha_data);
+ else
+ text = g_strdup("");
+
+ if (cc_result_noti->sub_address.subaddress_len > 0)
+ sub_addr = g_strdup(cc_result_noti->sub_address.subaddress);
+ else
+ sub_addr = g_strdup("");
+
+ if (cc_result_noti->ccp1.data_len > 0)
+ ccp1 = g_strdup(cc_result_noti->ccp1.data);
+ else
+ ccp1 = g_strdup("");
+
+ if (cc_result_noti->ccp2.data_len > 0)
+ ccp2 = g_strdup(cc_result_noti->ccp2.data);
+ else
+ ccp2 = g_strdup("");
+
+ telephony_sat_emit_call_control_result(sat,
+ call_ctrl_result, text, ton, npi, call_num,
+ ss_string, sub_addr, ccp1, ccp2, bc_repeat_indicator);
+
+ g_free(text);
+ g_free(call_num);
+ g_free(ss_string);
+ g_free(sub_addr);
+ g_free(ccp1);
+ g_free(ccp2);
+ }
+ break;
+
+ case TNOTI_SAT_MO_SM_CTRL_RESULT: {
+ struct tnoti_sat_mo_sm_control_result_ind *mo_sm_result_noti = NULL;
+ gint call_ctrl_result = 0;
+ gint rp_dst_ton = 0x0F, rp_dst_npi = 0X0F, tp_dst_ton = 0x0F, tp_dst_npi = 0X0F;
+ gchar *text = NULL, *rp_dst_call_num = NULL, *tp_dst_call_num = NULL;
+
+ mo_sm_result_noti = (struct tnoti_sat_mo_sm_control_result_ind *)data;
+ if (mo_sm_result_noti == NULL) {
+ err("Indication data is NULL");
+ return FALSE;
+ }
+
+ dbg("[%s] SAT_MO_SM_CTRL_RESULT - Result: [%s]", cp_name,
+ (mo_sm_result_noti->cc_result == call_control_allowed_no_mod ? "No Modification" :
+ (mo_sm_result_noti->cc_result == call_control_allowed_with_mod ? "Allowed Modification" :
+ "NOT Allowed")));
+
+ call_ctrl_result = mo_sm_result_noti->cc_result;
+
+ if (mo_sm_result_noti->rp_dst_address.dialing_number_len > 0) {
+ rp_dst_ton = mo_sm_result_noti->rp_dst_address.ton;
+ rp_dst_npi = mo_sm_result_noti->rp_dst_address.npi;
+ if (rp_dst_ton == TON_INTERNATIONAL)
+ rp_dst_call_num = g_strdup_printf("+%s", mo_sm_result_noti->rp_dst_address.dialing_number);
+ else
+ rp_dst_call_num = g_strdup(mo_sm_result_noti->rp_dst_address.dialing_number);
+ } else {
+ rp_dst_call_num = g_strdup("");
+ }
+
+ if (mo_sm_result_noti->tp_dst_address.dialing_number_len > 0) {
+ tp_dst_ton = mo_sm_result_noti->tp_dst_address.ton;
+ tp_dst_npi = mo_sm_result_noti->tp_dst_address.npi;
+ if (tp_dst_ton == TON_INTERNATIONAL)
+ tp_dst_call_num = g_strdup_printf("+%s", mo_sm_result_noti->tp_dst_address.dialing_number);
+ else
+ tp_dst_call_num = g_strdup(mo_sm_result_noti->tp_dst_address.dialing_number);
+ } else {
+ tp_dst_call_num = g_strdup("");
+ }
+
+ if (mo_sm_result_noti->alpha_id.alpha_data_len > 0)
+ text = g_strdup(mo_sm_result_noti->alpha_id.alpha_data);
+ else
+ text = g_strdup("");
+
+ telephony_sat_emit_mo_sm_control_result(sat,
+ call_ctrl_result, text,
+ rp_dst_ton, rp_dst_npi, rp_dst_call_num, tp_dst_ton, tp_dst_npi, tp_dst_call_num);
+
+ g_free(text);
+ g_free(rp_dst_call_num);
+ g_free(tp_dst_call_num);
+ }
+ break;
+
+ case TNOTI_SAT_PROACTIVE_CMD: { /* Proactive Command Notification */
+ struct tnoti_sat_proactive_ind *p_ind;
+ TcorePlugin *plg;
+
+ plg = tcore_object_ref_plugin(source);
+ if (plg == NULL) {
+ err("there is no valid plugin at this point");
+ return FALSE;
+ }
+
+ if (cp_name == NULL) {
+ err("CP name is NULL");
+ return FALSE;
+ }
+
+ p_ind = (struct tnoti_sat_proactive_ind *)data;
+ if (p_ind == NULL) {
+ err("Indication data is NULL");
+ return FALSE;
+ }
+
+ dbg("[%s] SAT_PROACTIVE_CMD - [0x%02x]", cp_name, p_ind->cmd_type);
+
+ switch (p_ind->cmd_type) {
+ case SAT_PROATV_CMD_SETUP_MENU: {
+ GVariant *menu_info = NULL;
+ gchar *title;
+ gint command_id, menu_cnt;
+ gboolean b_present, b_helpinfo, b_updated;
+ GVariant *items;
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ GVariant *icon_id = NULL;
+ GVariant *icon_list = NULL;
+#endif
+ menu_info = sat_manager_caching_setup_menu_info(ctx, cp_name,
+ (struct tel_sat_setup_menu_tlv*)&p_ind->proactive_ind_data.setup_menu);
+
+ dbg("PROATV_CMD_SETUP_MENU - type_format: [%s]",
+ g_variant_get_type_string(menu_info));
+
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ g_variant_get(menu_info, "(ibs@vibb@v@v)", &command_id, &b_present, &title, &items,
+ &menu_cnt, &b_helpinfo, &b_updated, &icon_id, &icon_list);
+#else
+ g_variant_get(menu_info, "(ibs@vibb)", &command_id, &b_present, &title, &items,
+ &menu_cnt, &b_helpinfo, &b_updated);
+#endif
+ if (!menu_cnt) {
+ dbg("NO Main Menu data");
+
+ /*
+ * No need to cache anything so make store NULL
+ * in cached_sat_main_menu
+ */
+ __sat_set_main_menu(ctx, cp_name, NULL);
+ g_variant_unref(menu_info);
+ } else {
+ __sat_set_main_menu(ctx, cp_name, menu_info);
+ }
+
+ if (b_updated) {
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ telephony_sat_emit_setup_menu(sat, command_id, b_present, title, items, menu_cnt,
+ b_helpinfo, b_updated, icon_id, icon_list);
+#else
+ telephony_sat_emit_setup_menu(sat, command_id, b_present, title, items, menu_cnt,
+ b_helpinfo, b_updated);
+#endif
+ }
+
+ g_free(title);
+ }
+ break;
+
+ case SAT_PROATV_CMD_DISPLAY_TEXT: {
+ GVariant *display_text = NULL;
+
+ gint command_id, text_len, duration;
+ gboolean high_priority, user_rsp_required, immediately_rsp;
+ gchar* text = NULL;
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ GVariant *icon_id = NULL;
+#endif
+ int ret;
+
+ display_text = sat_manager_display_text_noti(ctx, cp_name,
+ (struct tel_sat_display_text_tlv *)&p_ind->proactive_ind_data.display_text,
+ p_ind->decode_err_code);
+ if (!display_text) {
+ dbg("NO Display text data");
+ return TRUE;
+ }
+
+ dbg("PROATV_CMD_DISPLAY_TEXT - type_format: [%s]",
+ g_variant_get_type_string(display_text));
+
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ g_variant_get(display_text, "(isiibbb@v)", &command_id, &text, &text_len, &duration,
+ &high_priority, &user_rsp_required, &immediately_rsp, &icon_id);
+#else
+ g_variant_get(display_text, "(isiibbb)", &command_id, &text, &text_len, &duration,
+ &high_priority, &user_rsp_required, &immediately_rsp);
+#endif
+
+ ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_DISPLAY_TEXT,
+ display_text, slot_id);
+ if (!ret) {
+ int rv;
+
+ err("Failed to launch 'sat-ui', remove the queued data!!!");
+
+ if (!sat_manager_handle_sat_ui_launch_fail(ctx, cp_name, p_ind))
+ dbg("Failed to send Terminal Response!!!");
+
+ rv = sat_manager_remove_cmd_by_id(ctx, command_id);
+ if (!rv)
+ dbg("Failed to de-queue data\n");
+ }
+
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ telephony_sat_emit_display_text(sat, command_id, text, text_len, duration,
+ high_priority, user_rsp_required, immediately_rsp, icon_id);
+#else
+ telephony_sat_emit_display_text(sat, command_id, text, text_len, duration,
+ high_priority, user_rsp_required, immediately_rsp);
+#endif
+
+ g_free(text);
+ }
+ break;
+
+ case SAT_PROATV_CMD_SELECT_ITEM: {
+ GVariant *select_menu = NULL;
+ gboolean help_info ;
+ gchar *selected_text = NULL;
+ gint command_id, default_item_id, menu_cnt, text_len = 0;
+ GVariant *menu_items;
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ GVariant *icon_id, *icon_list;
+#endif
+ int ret;
+
+ select_menu = sat_manager_select_item_noti(ctx, cp_name,
+ (struct tel_sat_select_item_tlv *)&p_ind->proactive_ind_data.select_item);
+ if (!select_menu) {
+ dbg("NO Select menu data");
+ return TRUE;
+ }
+
+ dbg("PROATV_CMD_SELECT_ITEM - type_format: [%s]",
+ g_variant_get_type_string(select_menu));
+
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ g_variant_get(select_menu, "(ibsiii@v@v@v)", &command_id, &help_info, &selected_text,
+ &text_len, &default_item_id, &menu_cnt, &menu_items, &icon_id, &icon_list);
+#else
+ g_variant_get(select_menu, "(ibsiii@v)", &command_id, &help_info, &selected_text,
+ &text_len, &default_item_id, &menu_cnt, &menu_items);
+#endif
+ ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_SELECT_ITEM,
+ select_menu, slot_id);
+ if (!ret) {
+ int rv;
+
+ err("Failed to launch 'sat-ui', remove the queued data!!!");
+
+ if (!sat_manager_handle_sat_ui_launch_fail(ctx, cp_name, p_ind))
+ dbg("Failed to send Terminal Response!!!");
+
+ rv = sat_manager_remove_cmd_by_id(ctx, command_id);
+ if (!rv)
+ dbg("Failed to de-queue data\n");
+ }
+
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ telephony_sat_emit_select_item(sat, command_id, help_info, selected_text, text_len,
+ default_item_id, menu_cnt, menu_items, icon_id, icon_list);
+#else
+ telephony_sat_emit_select_item(sat, command_id, help_info, selected_text, text_len,
+ default_item_id, menu_cnt, menu_items);
+#endif
+
+ g_free(selected_text);
+ }
+ break;
+
+ case SAT_PROATV_CMD_GET_INKEY: {
+ GVariant *get_inkey = NULL;
+ gint command_id, key_type, input_character_mode;
+ gint text_len, duration;
+ gboolean b_numeric, b_help_info;
+ gchar *text = NULL;
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ GVariant *icon_id;
+#endif
+ int ret;
+
+ get_inkey = sat_manager_get_inkey_noti(ctx, cp_name,
+ (struct tel_sat_get_inkey_tlv *)&p_ind->proactive_ind_data.get_inkey,
+ p_ind->decode_err_code);
+
+ if (!get_inkey) {
+ dbg("NO Get Inkey data");
+ return TRUE;
+ }
+
+ dbg("PROATV_CMD_GET_INKEY - type_format: [%s]",
+ g_variant_get_type_string(get_inkey));
+
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ g_variant_get(get_inkey, "(iiibbsii@v)", &command_id, &key_type, &input_character_mode,
+ &b_numeric, &b_help_info, &text, &text_len, &duration, &icon_id);
+#else
+ g_variant_get(get_inkey, "(iiibbsii)", &command_id, &key_type, &input_character_mode,
+ &b_numeric, &b_help_info, &text, &text_len, &duration);
+#endif
+
+ ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_GET_INKEY,
+ get_inkey, slot_id);
+ if (!ret) {
+ int rv;
+
+ err("Failed to launch 'sat-ui', remove the queued data!!!");
+
+ if (!sat_manager_handle_sat_ui_launch_fail(ctx, cp_name, p_ind))
+ dbg("Failed to send Terminal Response!!!");
+
+ rv = sat_manager_remove_cmd_by_id(ctx, command_id);
+ if (!rv)
+ dbg("Failed to de-queue data\n");
+ }
+
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ telephony_sat_emit_get_inkey(sat, command_id, key_type, input_character_mode,
+ b_numeric, b_help_info, text, text_len, duration, icon_id);
+#else
+ telephony_sat_emit_get_inkey(sat, command_id, key_type, input_character_mode,
+ b_numeric, b_help_info, text, text_len, duration);
+#endif
+
+ g_free(text);
+ }
+ break;
+
+ case SAT_PROATV_CMD_GET_INPUT: {
+ GVariant *get_input = NULL;
+ gint command_id, input_character_mode;
+ gint text_len, def_text_len, rsp_len_min, rsp_len_max;
+ gboolean b_numeric, b_help_info, b_echo_input;
+ gchar *text = NULL, *def_text = NULL;
+ int ret;
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ GVariant *icon_id;
+#endif
+ get_input = sat_manager_get_input_noti(ctx, cp_name,
+ (struct tel_sat_get_input_tlv *)&p_ind->proactive_ind_data.get_input,
+ p_ind->decode_err_code);
+ if (!get_input) {
+ dbg("NO Get Input data");
+ return TRUE;
+ }
+
+ dbg("PROATV_CMD_GET_INPUT - type_format: [%s]",
+ g_variant_get_type_string(get_input));
+
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ g_variant_get(get_input, "(iibbbsiiisi@v)", &command_id,
+ &input_character_mode, &b_numeric, &b_help_info,
+ &b_echo_input, &text, &text_len, &rsp_len_max,
+ &rsp_len_min, &def_text, &def_text_len, &icon_id);
+#else
+ g_variant_get(get_input, "(iibbbsiiisi)", &command_id,
+ &input_character_mode, &b_numeric, &b_help_info,
+ &b_echo_input, &text, &text_len, &rsp_len_max,
+ &rsp_len_min, &def_text, &def_text_len);
+#endif
+
+ ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_GET_INPUT,
+ get_input, slot_id);
+ if (!ret) {
+ int rv;
+
+ err("Failed to launch 'sat-ui', remove the queued data!!!");
+
+ if (!sat_manager_handle_sat_ui_launch_fail(ctx, cp_name, p_ind))
+ dbg("Failed to send Terminal Response!!!");
+
+ rv = sat_manager_remove_cmd_by_id(ctx, command_id);
+ if (!rv)
+ dbg("Failed to de-queue data\n");
+ }
+
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ telephony_sat_emit_get_input(sat, command_id, input_character_mode, b_numeric, b_help_info,
+ b_echo_input, text, text_len, rsp_len_max, rsp_len_min, def_text, def_text_len, icon_id);
+#else
+ telephony_sat_emit_get_input(sat, command_id, input_character_mode, b_numeric, b_help_info,
+ b_echo_input, text, text_len, rsp_len_max, rsp_len_min, def_text, def_text_len);
+#endif
+
+ g_free(text);
+ g_free(def_text);
+ }
+ break;
+
+ case SAT_PROATV_CMD_PLAY_TONE: {
+ GVariant *play_tone = NULL;
+ gint command_id, tone_type, duration;
+ gint text_len;
+ gchar* text = NULL;
+ int ret;
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ GVariant *icon_id;
+#endif
+
+ play_tone = sat_manager_play_tone_noti(ctx, cp_name,
+ (struct tel_sat_play_tone_tlv *)&p_ind->proactive_ind_data.play_tone);
+ if (!play_tone) {
+ dbg("NO Play Tone data");
+ return TRUE;
+ }
+
+ dbg("PROATV_CMD_PLAY_TONE - type_format: [%s]",
+ g_variant_get_type_string(play_tone));
+
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ g_variant_get(play_tone, "(isi@vii)", &command_id, &text, &text_len, &icon_id, &tone_type, &duration);
+#else
+ g_variant_get(play_tone, "(isiii)", &command_id, &text, &text_len, &tone_type, &duration);
+#endif
+
+ ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_PLAY_TONE, play_tone, slot_id);
+ if (!ret) {
+ int rv;
+
+ err("Failed to launch 'sat-ui', remove the queued data!!!");
+
+ if (!sat_manager_handle_sat_ui_launch_fail(ctx, cp_name, p_ind))
+ dbg("Failed to send Terminal Response!!!");
+
+ rv = sat_manager_remove_cmd_by_id(ctx, command_id);
+ if (!rv)
+ dbg("Failed to de-queue data\n");
+ }
+
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ telephony_sat_emit_play_tone(sat, command_id, text, text_len, icon_id, tone_type, duration);
+#else
+ telephony_sat_emit_play_tone(sat, command_id, text, text_len, tone_type, duration);
+#endif
+
+ g_free(text);
+ }
+ break;
+
+ case SAT_PROATV_CMD_SEND_SMS: {
+ GVariant *send_sms = NULL;
+ gint command_id, ton, npi, tpdu_type;
+ gboolean b_packing_required;
+ gint text_len, number_len, tpdu_data_len;
+ gchar* text = NULL, *dialling_number = NULL;
+ GVariant *tpdu_data;
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ GVariant *icon_id;
+#endif
+
+ send_sms = sat_manager_send_sms_noti(ctx, cp_name,
+ (struct tel_sat_send_sms_tlv *)&p_ind->proactive_ind_data.send_sms);
+ if (!send_sms) {
+ dbg("NO Send SMS data");
+ return TRUE;
+ }
+
+ dbg("PROATV_CMD_SEND_SMS - type_format: [%s]",
+ g_variant_get_type_string(send_sms));
+
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ g_variant_get(send_sms, "(isi@vbiisii@vi)", &command_id,
+ &text, &text_len, &icon_id, &b_packing_required, &ton, &npi,
+ &dialling_number, &number_len, &tpdu_type, &tpdu_data, &tpdu_data_len);
+#else
+ g_variant_get(send_sms, "(isibiisii@vi)", &command_id,
+ &text, &text_len, &b_packing_required, &ton, &npi,
+ &dialling_number, &number_len, &tpdu_type, &tpdu_data, &tpdu_data_len);
+#endif
+
+ dbg("Display text - text: [%s] text len: [%d]", text, text_len);
+ if (text_len > 1 && (g_strcmp0(text, "") != 0)) {
+ GVariant *ui_info = NULL;
+ gboolean user_confirm = FALSE;
+ int ret;
+
+ dbg("Text should be displayed by UI - Send SMS is pending!!!");
+
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ ui_info = g_variant_new("(isibv)", command_id, text, text_len, user_confirm, icon_id);
+#else
+ ui_info = g_variant_new("(isib)", command_id, text, text_len, user_confirm);
+#endif
+
+ ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_SEND_SMS,
+ ui_info, slot_id);
+ if (!ret) {
+ int rv;
+
+ err("Failed to launch 'sat-ui', remove the queued data!!!");
+
+ if (!sat_manager_handle_sat_ui_launch_fail(ctx, cp_name, p_ind))
+ dbg("Failed to send Terminal Response!!!");
+
+ rv = sat_manager_remove_cmd_by_id(ctx, command_id);
+ if (!rv)
+ dbg("Failed to de-queue data\n");
+ }
+
+ g_free(text);
+ g_free(dialling_number);
+
+ return TRUE;
+ }
+
+#if !defined(TIZEN_PLATFORM_USE_QCOM_QMI)
+ telephony_sat_emit_send_sms(sat, command_id, text, text_len, b_packing_required,
+ ton, npi, dialling_number, number_len, tpdu_type, tpdu_data, tpdu_data_len);
+#endif
+
+ g_free(text);
+ g_free(dialling_number);
+ }
+ break;
+
+ case SAT_PROATV_CMD_SEND_SS: {
+ GVariant *send_ss = NULL;
+ gint command_id, ton, npi;
+ gint text_len, ss_str_len;
+ gchar* text = NULL, *ss_string = NULL;
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ GVariant *icon_id;
+#endif
+
+ send_ss = sat_manager_send_ss_noti(ctx, cp_name,
+ (struct tel_sat_send_ss_tlv *)&p_ind->proactive_ind_data.send_ss);
+ if (!send_ss) {
+ dbg("NO Send SS data");
+ return TRUE;
+ }
+
+ dbg("PROATV_CMD_SEND_SS - type_format: [%s]",
+ g_variant_get_type_string(send_ss));
+
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ g_variant_get(send_ss, "(isi@viiis)", &command_id, &text, &text_len, &icon_id,
+ &ton, &npi, &ss_str_len, &ss_string);
+#else
+ g_variant_get(send_ss, "(isiiiis)", &command_id, &text, &text_len,
+ &ton, &npi, &ss_str_len, &ss_string);
+#endif
+
+ dbg("Display text - text: [%s] text len: [%d]", text, text_len);
+ if (text_len > 1 && (g_strcmp0(text, "") != 0)) {
+ GVariant *ui_info = NULL;
+ gboolean user_confirm = FALSE;
+ int ret;
+
+ dbg("Text should be displayed by UI - Send SS is pending!!!");
+
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ ui_info = g_variant_new("(isibv)", command_id, text, text_len, user_confirm, icon_id);
+#else
+ ui_info = g_variant_new("(isib)", command_id, text, text_len, user_confirm);
+#endif
+
+ ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_NONE,
+ ui_info, slot_id);
+ if (!ret) {
+ int rv;
+
+ err("Failed to launch 'sat-ui', remove the queued data!!!");
+
+ if (!sat_manager_handle_sat_ui_launch_fail(ctx, cp_name, p_ind))
+ dbg("Failed to send Terminal Response!!!");
+
+ rv = sat_manager_remove_cmd_by_id(ctx, command_id);
+ if (!rv)
+ dbg("Failed to de-queue data\n");
+ }
+
+ g_free(text);
+ g_free(ss_string);
+
+ return TRUE;
+ }
+
+#if !defined(TIZEN_PLATFORM_USE_QCOM_QMI)
+ telephony_sat_emit_send_ss(sat,
+ command_id, text, text_len, ton, npi, ss_string);
+
+ /*
+ * Tizen CISS
+ */
+ sat_ui_support_launch_ciss_application(SAT_PROATV_CMD_SEND_SS,
+ send_ss, slot_id);
+#endif
+
+ g_free(text);
+ g_free(ss_string);
+ }
+ break;
+
+ case SAT_PROATV_CMD_SEND_USSD: {
+ GVariant *send_ussd = NULL;
+ gint command_id;
+ gint text_len, ussd_str_len;
+ guchar dcs;
+ gchar* text = NULL, *ussd_string = NULL;
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ GVariant *icon_id;
+#endif
+
+ send_ussd = sat_manager_send_ussd_noti(ctx, cp_name,
+ (struct tel_sat_send_ussd_tlv *)&p_ind->proactive_ind_data.send_ussd);
+ if (!send_ussd) {
+ dbg("NO Send USSD data");
+ return TRUE;
+ }
+
+ dbg("PROATV_CMD_SEND_USSD - type_format: [%s]",
+ g_variant_get_type_string(send_ussd));
+
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ g_variant_get(send_ussd, "(isi@vyis)", &command_id, &text, &text_len, &icon_id, &dcs, &ussd_str_len, &ussd_string);
+#else
+ g_variant_get(send_ussd, "(isiyis)", &command_id, &text, &text_len, &dcs, &ussd_str_len, &ussd_string);
+#endif
+
+ dbg("Display text - text: [%s] text len: [%d]", text, text_len);
+ if (text_len > 1 && (g_strcmp0(text, "") != 0)) {
+ GVariant *ui_info = NULL;
+ gboolean user_confirm = FALSE;
+ int ret;
+
+ dbg("Text should be displayed by UI -Send USSD is pending!!!");
+
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ ui_info = g_variant_new("(isibv)", command_id, text, text_len, user_confirm, icon_id);
+#else
+ ui_info = g_variant_new("(isib)", command_id, text, text_len, user_confirm);
+#endif
+
+ ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_NONE,
+ ui_info, slot_id);
+ if (!ret) {
+ int rv;
+
+ err("Failed to launch 'sat-ui', remove the queued data!!!");
+
+ if (!sat_manager_handle_sat_ui_launch_fail(ctx, cp_name, p_ind))
+ dbg("Failed to send Terminal Response!!!");
+
+ rv = sat_manager_remove_cmd_by_id(ctx, command_id);
+ if (!rv)
+ dbg("Failed to de-queue data\n");
+ }
+
+ g_free(text);
+ g_free(ussd_string);
+
+ return TRUE;
+ }
+
+#if !defined(TIZEN_PLATFORM_USE_QCOM_QMI)
+ telephony_sat_emit_setup_ussd(sat,
+ command_id, text, text_len, dcs, ussd_string);
+
+ /*
+ * Tizen CISS UI
+ */
+ sat_ui_support_launch_ciss_application(SAT_PROATV_CMD_SEND_USSD,
+ send_ussd, slot_id);
+#endif
+ g_free(text);
+ g_free(ussd_string);
+ }
+ break;
+
+ case SAT_PROATV_CMD_SETUP_CALL: {
+ GVariant *setup_call = NULL;
+ gint command_id, call_type, confirmed_text_len, text_len, duration;
+ gchar *confirmed_text, *text = NULL, *call_number = NULL;
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ GVariant *icon_id;
+#endif
+
+ setup_call = sat_manager_setup_call_noti(ctx, cp_name,
+ (struct tel_sat_setup_call_tlv *)&p_ind->proactive_ind_data.setup_call);
+ if (!setup_call) {
+ dbg("NO Setup Call data");
+ return TRUE;
+ }
+
+ dbg("PROATV_CMD_SETUP_CALL - type_format: [%s]",
+ g_variant_get_type_string(setup_call));
+
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ g_variant_get(setup_call, "(isisi@visi)", &command_id,
+ &confirmed_text, &confirmed_text_len,
+ &text, &text_len, &icon_id, &call_type,
+ &call_number, &duration);
+#else
+ g_variant_get(setup_call, "(isisiisi)", &command_id,
+ &confirmed_text, &confirmed_text_len,
+ &text, &text_len, &call_type, &call_number, &duration);
+#endif
+
+ dbg("Display text - text: [%s] text len: [%d]", confirmed_text, confirmed_text_len);
+ if (confirmed_text_len > 1 && (g_strcmp0(confirmed_text, "") != 0)) {
+ GVariant *ui_info = NULL;
+ gboolean user_confirm = TRUE;
+ int ret;
+
+ dbg("Text should be displayed by UI - Setup call is pending!!!");
+
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ ui_info = g_variant_new("(isibv)", command_id,
+ confirmed_text, confirmed_text_len,
+ user_confirm, icon_id);
+#else
+ ui_info = g_variant_new("(isib)", command_id,
+ confirmed_text, confirmed_text_len,
+ user_confirm);
+#endif
+
+ ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_NONE,
+ ui_info, slot_id);
+ if (!ret) {
+ int rv;
+
+ err("Failed to launch 'sat-ui', remove the queued data!!!");
+
+ if (!sat_manager_handle_sat_ui_launch_fail(ctx, cp_name, p_ind))
+ dbg("Failed to send Terminal Response!!!");
+
+ rv = sat_manager_remove_cmd_by_id(ctx, command_id);
+ if (!rv)
+ dbg("Failed to de-queue data\n");
+ }
+
+ g_free(text);
+ g_free(call_number);
+
+ return TRUE;
+ }
+ /* In case of No user confirm phase AlphaID in SETUP CALL noti.
+ * Ref.) ETSI TS 102 223 : Section 6.4.13 and 6.6.12
+ */
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ telephony_sat_emit_setup_call(sat,
+ command_id, confirmed_text, confirmed_text_len,
+ text, text_len, icon_id, call_type, call_number, duration);
+#else
+ telephony_sat_emit_setup_call(sat,
+ command_id, confirmed_text, confirmed_text_len,
+ text, text_len, call_type, call_number, duration);
+#endif
+ g_free(text);
+ g_free(call_number);
+ }
+ break;
+
+ case SAT_PROATV_CMD_SETUP_EVENT_LIST: {
+ GVariant *event_list = NULL;
+ guchar event_cnt;
+ GVariant *evt_list;
+
+ event_list = sat_manager_setup_event_list_noti(ctx, cp_name,
+ (struct tel_sat_setup_event_list_tlv *)&p_ind->proactive_ind_data.setup_event_list);
+ if (!event_list) {
+ dbg("NO Setup Event list data");
+ return TRUE;
+ }
+
+ dbg("PROATV_CMD_SETUP_EVENT_LIST - type_format: [%s]",
+ g_variant_get_type_string(event_list));
+
+ g_variant_get(event_list, "(y@v)", &event_cnt, &evt_list);
+ telephony_sat_emit_setup_event_list(sat, event_cnt, evt_list);
+
+ /*
+ * BIP pro-active command is only handled
+ * by BIP Manager
+ */
+ {
+ GDBusConnection *conn = NULL;
+ const gchar *g_path = NULL;
+
+ conn = g_dbus_object_manager_server_get_connection(ctx->manager);
+ g_path = g_dbus_object_get_object_path(G_DBUS_OBJECT(object));
+
+ /*
+ * TODO -
+ * SAT Event Downloader should execute
+ * event_list as well.
+ */
+ sat_ui_support_launch_eventdownloader_application(event_list, slot_id);
+
+ sat_ui_support_exec_bip(conn, g_path,
+ SAT_PROATV_CMD_SETUP_EVENT_LIST, event_list);
+ }
+ }
+ break;
+
+ case SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT: {
+ GVariant *setup_idle_mode = NULL;
+ int ret;
+ gint command_id, text_len;
+ gchar* text = NULL;
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ GVariant *icon_id;
+#endif
+ setup_idle_mode = sat_manager_setup_idle_mode_text_noti(ctx, cp_name,
+ (struct tel_sat_setup_idle_mode_text_tlv *)&p_ind->proactive_ind_data.setup_idle_mode_text,
+ p_ind->decode_err_code);
+ if (!setup_idle_mode) {
+ dbg("NO Setup Idle mode text data");
+ return TRUE;
+ }
+
+ dbg("PROATV_CMD_SETUP_IDLE_MODE_TEXT - type_format: [%s]",
+ g_variant_get_type_string(setup_idle_mode));
+
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ g_variant_get(setup_idle_mode, "(isi@v)", &command_id,
+ &text, &text_len, &icon_id);
+#else
+ g_variant_get(setup_idle_mode, "(isi)", &command_id,
+ &text, &text_len);
+#endif
+
+ ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT,
+ setup_idle_mode, slot_id);
+ if (!ret) {
+ int rv;
+
+ err("Failed to launch 'sat-ui', remove the queued data!!!");
+
+ if (!sat_manager_handle_sat_ui_launch_fail(ctx, cp_name, p_ind))
+ dbg("Failed to send Terminal Response!!!");
+
+ rv = sat_manager_remove_cmd_by_id(ctx, command_id);
+ if (!rv)
+ dbg("Failed to de-queue data\n");
+ }
+
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ telephony_sat_emit_setup_idle_mode_text(sat,
+ command_id, text, text_len, icon_id);
+#else
+ telephony_sat_emit_setup_idle_mode_text(sat,
+ command_id, text, text_len);
+#endif
+
+ g_free(text);
+ }
+ break;
+
+ case SAT_PROATV_CMD_OPEN_CHANNEL: {
+ GVariant *open_channel = NULL;
+ gint command_id, bearer_type, protocol_type, dest_addr_type;
+ gboolean immediate_link, auto_reconnection, bg_mode;
+ gint text_len, buffer_size, port_number;
+ gchar *text = NULL, *dest_address;
+ GVariant *bearer_param;
+ GVariant *bearer_detail;
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ GVariant *icon_id;
+#endif
+
+ open_channel = sat_manager_open_channel_noti(ctx, cp_name,
+ (struct tel_sat_open_channel_tlv *)&p_ind->proactive_ind_data.open_channel);
+ if (!open_channel) {
+ dbg("NO Open Channel data");
+ return TRUE;
+ }
+
+ dbg("PROATV_CMD_OPEN_CHANNEL - type_format: [%s]",
+ g_variant_get_type_string(open_channel));
+
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ g_variant_get(open_channel, "(isi@vbbbi@viiiis@v)", &command_id,
+ &text, &text_len, &icon_id, &immediate_link, &auto_reconnection, &bg_mode,
+ &bearer_type, &bearer_param, &buffer_size, &protocol_type,
+ &port_number, &dest_addr_type, &dest_address, &bearer_detail);
+#else
+ g_variant_get(open_channel, "(isibbbi@viiiis@v)", &command_id,
+ &text, &text_len, &immediate_link, &auto_reconnection, &bg_mode,
+ &bearer_type, &bearer_param, &buffer_size, &protocol_type,
+ &port_number, &dest_addr_type, &dest_address, &bearer_detail);
+#endif
+
+ dbg("Display text - text: [%s] text len: [%d]", text, text_len);
+ if (text_len > 1 && (g_strcmp0(text, "") != 0)) {
+ GVariant *ui_info = NULL;
+ gboolean user_confirm = TRUE;
+ int ret;
+
+ dbg("Text should be displayed by UI- Open Channel text is displayed!!!");
+
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ ui_info = g_variant_new("(isibv)", command_id,
+ text, text_len, user_confirm, icon_id);
+#else
+ ui_info = g_variant_new("(isib)", command_id,
+ text, text_len, user_confirm);
+#endif
+
+ ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_NONE,
+ ui_info, slot_id);
+ if (!ret) {
+ int rv;
+
+ err("Failed to launch 'sat-ui', remove the queued data!!!");
+
+ if (!sat_manager_handle_sat_ui_launch_fail(ctx, cp_name, p_ind))
+ dbg("Failed to send Terminal Response!!!");
+
+ rv = sat_manager_remove_cmd_by_id(ctx, command_id);
+ if (!rv)
+ dbg("Failed to de-queue data\n");
+ }
+
+ g_free(text);
+ g_free(dest_address);
+
+ return TRUE;
+ }
+
+ g_free(text);
+ g_free(dest_address);
+
+#if 0
+ telephony_sat_emit_open_channel(sat, command_id,
+ text, text_len, immediate_link, auto_reconnection, bg_mode,
+ bearer_type, bearer_param, buffer_size, protocol_type, port_number,
+ dest_addr_type, dest_address, bearer_detail);
+#endif
+
+#if !defined(TIZEN_PLATFORM_USE_QCOM_QMI)
+ /*
+ * BIP pro-active command is only handled
+ * by BIP Manager
+ */
+ {
+ GDBusConnection *conn = NULL;
+ const gchar *g_path = NULL;
+
+ conn = g_dbus_object_manager_server_get_connection(ctx->manager);
+ g_path = g_dbus_object_get_object_path(G_DBUS_OBJECT(object));
+
+ sat_ui_support_exec_bip(conn, g_path,
+ SAT_PROATV_CMD_OPEN_CHANNEL, open_channel);
+ }
+#endif
+ }
+ break;
+
+ case SAT_PROATV_CMD_CLOSE_CHANNEL: {
+ GVariant *close_channel = NULL;
+ gint command_id, channel_id, text_len;
+ gchar *text = NULL;
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ GVariant *icon_id;
+#endif
+
+ close_channel = sat_manager_close_channel_noti(ctx, cp_name,
+ (struct tel_sat_close_channel_tlv *)&p_ind->proactive_ind_data.close_channel);
+ if (!close_channel) {
+ dbg("NO Close Channel data");
+ return TRUE;
+ }
+
+ /*
+ * TODO -
+ * Check the data for sat-ui
+ */
+ dbg("PROATV_CMD_CLOSE_CHANNEL - type_format: [%s]",
+ g_variant_get_type_string(close_channel));
+
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ g_variant_get(close_channel, "(isi@vi)", &command_id,
+ &text, &text_len, &icon_id, &channel_id);
+#else
+ g_variant_get(close_channel, "(isii)", &command_id,
+ &text, &text_len, &channel_id);
+#endif
+
+#if 0
+ telephony_sat_emit_close_channel(sat,
+ command_id, text, text_len, channel_id);
+#endif
+
+ /*
+ * BIP pro-active command is only handled
+ * by BIP Manager
+ */
+ {
+ GDBusConnection *conn = NULL;
+ const gchar *g_path = NULL;
+
+ conn = g_dbus_object_manager_server_get_connection(ctx->manager);
+ g_path = g_dbus_object_get_object_path(G_DBUS_OBJECT(object));
+
+ sat_ui_support_exec_bip(conn, g_path,
+ SAT_PROATV_CMD_CLOSE_CHANNEL, close_channel);
+ }
+
+ g_free(text);
+ }
+ break;
+
+ case SAT_PROATV_CMD_RECEIVE_DATA: {
+ GVariant *receive_data = NULL;
+ gint command_id, text_len, channel_id, channel_data_len = 0;
+ gchar *text = NULL;
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ GVariant *icon_id;
+#endif
+
+ receive_data = sat_manager_receive_data_noti(ctx, cp_name,
+ (struct tel_sat_receive_channel_tlv *)&p_ind->proactive_ind_data.receive_data);
+ if (!receive_data) {
+ dbg("NO Receive data data");
+ return TRUE;
+ }
+
+ /*
+ * TODO -
+ * Check the data for sat-ui
+ */
+
+ dbg("PROATV_CMD_RECEIVE_DATA - type_format: [%s]",
+ g_variant_get_type_string(receive_data));
+
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ g_variant_get(receive_data, "(isi@vii)", &command_id,
+ &text, &text_len, &icon_id, &channel_id, &channel_data_len);
+#else
+ g_variant_get(receive_data, "(isiii)", &command_id,
+ &text, &text_len, &channel_id, &channel_data_len);
+#endif
+
+#if 0
+ telephony_sat_emit_receive_data(sat,
+ command_id, text, text_len, channel_id, channel_data_len);
+#endif
+
+ /*
+ * BIP pro-active command is only handled
+ * by BIP Manager
+ */
+ {
+ GDBusConnection *conn = NULL;
+ const gchar *g_path = NULL;
+
+ conn = g_dbus_object_manager_server_get_connection(ctx->manager);
+ g_path = g_dbus_object_get_object_path(G_DBUS_OBJECT(object));
+
+ sat_ui_support_exec_bip(conn, g_path,
+ SAT_PROATV_CMD_RECEIVE_DATA, receive_data);
+ }
+
+ g_free(text);
+ }
+ break;
+
+ case SAT_PROATV_CMD_SEND_DATA: {
+ GVariant *send_data = NULL;
+ gint command_id, channel_id, text_len, channel_data_len;
+ gboolean send_data_immediately;
+ gchar *text = NULL;
+ GVariant *channel_data;
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ GVariant *icon_id;
+#endif
+
+ send_data = sat_manager_send_data_noti(ctx, cp_name,
+ (struct tel_sat_send_channel_tlv *)&p_ind->proactive_ind_data.send_data);
+ if (!send_data) {
+ dbg("NO Send data data");
+ return TRUE;
+ }
+
+ /*
+ * TODO -
+ * Check the data for sat-ui
+ */
+
+ dbg("PROATV_CMD_SEND_DATA - type_format: [%s]",
+ g_variant_get_type_string(send_data));
+
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ g_variant_get(send_data, "(isi@vib@vi)", &command_id,
+ &text, &text_len, &icon_id, &channel_id,
+ &send_data_immediately, &channel_data, &channel_data_len);
+#else
+ g_variant_get(send_data, "(isiib@vi)", &command_id,
+ &text, &text_len, &channel_id,
+ &send_data_immediately, &channel_data, &channel_data_len);
+#endif
+
+#if 0
+ telephony_sat_emit_send_data(sat,
+ command_id, text, text_len, channel_id,
+ send_data_immediately, channel_data, channel_data_len);
+#endif
+
+ /*
+ * BIP pro-active command is only handled
+ * by BIP Manager
+ */
+ {
+ GDBusConnection *conn = NULL;
+ const gchar *g_path = NULL;
+
+ conn = g_dbus_object_manager_server_get_connection(ctx->manager);
+ g_path = g_dbus_object_get_object_path(G_DBUS_OBJECT(object));
+
+ sat_ui_support_exec_bip(conn, g_path,
+ SAT_PROATV_CMD_SEND_DATA, send_data);
+ }
+
+ g_free(text);
+ }
+ break;
+
+ case SAT_PROATV_CMD_GET_CHANNEL_STATUS: {
+ GVariant *channel_status = NULL;
+ gint command_id;
+
+ channel_status = sat_manager_get_channel_status_noti(ctx, cp_name,
+ (struct tel_sat_get_channel_status_tlv *)&p_ind->proactive_ind_data.get_channel_status);
+ if (!channel_status) {
+ dbg("NO Get Channel Status data");
+ return TRUE;
+ }
+
+ /*
+ * TODO -
+ * Check the data for sat-ui
+ */
+
+ dbg("PROATV_CMD_GET_CHANNEL_STATUS - type_format: [%s]",
+ g_variant_get_type_string(channel_status));
+
+ g_variant_get(channel_status, "(i)", &command_id);
+
+#if 0
+ telephony_sat_emit_get_channel_status(sat, command_id);
+#endif
+
+ /*
+ * BIP pro-active command is only handled
+ * by BIP Manager
+ */
+ {
+ GDBusConnection *conn = NULL;
+ const gchar *g_path = NULL;
+
+ conn = g_dbus_object_manager_server_get_connection(ctx->manager);
+ g_path = g_dbus_object_get_object_path(G_DBUS_OBJECT(object));
+
+ sat_ui_support_exec_bip(conn, g_path,
+ SAT_PROATV_CMD_GET_CHANNEL_STATUS, channel_status);
+ }
+ }
+ break;
+
+ case SAT_PROATV_CMD_REFRESH: {
+ GVariant *refresh = NULL;
+ gint command_id = 0;
+ gint refresh_type = 0;
+ GVariant *file_list = NULL;
+ int ret;
+
+ refresh = sat_manager_refresh_noti(ctx, cp_name,
+ (struct tel_sat_refresh_tlv *)&p_ind->proactive_ind_data.refresh);
+ if (!refresh) {
+ dbg("NO Refresh data");
+ return TRUE;
+ }
+
+ dbg("PROATV_CMD_REFRESH - type_format: [%s]",
+ g_variant_get_type_string(refresh));
+
+ g_variant_get(refresh, "(ii@v)", &command_id,
+ &refresh_type, &file_list);
+
+ telephony_sat_emit_refresh(sat,
+ command_id, refresh_type, file_list);
+
+ ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_REFRESH,
+ refresh, slot_id);
+ if (!ret) {
+ int rv;
+
+ err("Failed to launch 'sat-ui', remove the queued data!!!");
+
+ if (!sat_manager_handle_sat_ui_launch_fail(ctx, cp_name, p_ind))
+ dbg("Failed to send Terminal Response!!!");
+
+ rv = sat_manager_remove_cmd_by_id(ctx, command_id);
+ if (!rv)
+ dbg("Failed to de-queue data\n");
+ }
+ }
+ break;
+
+ case SAT_PROATV_CMD_MORE_TIME: {
+ dbg("PROATV_CMD_MORE_TIME");
+
+ sat_manager_more_time_noti(ctx, cp_name,
+ (struct tel_sat_more_time_tlv *)&p_ind->proactive_ind_data.more_time);
+
+ telephony_sat_emit_more_time(sat);
+ }
+ break;
+
+ case SAT_PROATV_CMD_SEND_DTMF: {
+ GVariant *send_dtmf = NULL;
+ gint command_id = 0;
+ gint text_len = 0, dtmf_str_len = 0;
+ gchar *text = NULL;
+ gchar *dtmf_str = NULL;
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ GVariant *icon_id = NULL;
+#endif
+
+ send_dtmf = sat_manager_send_dtmf_noti(ctx, cp_name,
+ (struct tel_sat_send_dtmf_tlv *)&p_ind->proactive_ind_data.send_dtmf);
+ if (!send_dtmf) {
+ dbg("NO Send DTMF data");
+ return TRUE;
+ }
+
+ dbg("PROATV_CMD_SEND_DTMF - type_format: [%s]",
+ g_variant_get_type_string(send_dtmf));
+
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ g_variant_get(send_dtmf, "(isi@vis)", &command_id,
+ &text, &text_len, &icon_id, &dtmf_str_len, &dtmf_str);
+#else
+ g_variant_get(send_dtmf, "(isiis)", &command_id,
+ &text, &text_len, &dtmf_str_len, &dtmf_str);
+#endif
+
+ if (text_len > 1 && (g_strcmp0(text, "") != 0)) {
+ GVariant *ui_info = NULL;
+ gboolean user_confirm = FALSE;
+ int ret;
+
+ dbg("Text should be displayed by UI - Send DTMF is displayed!!!");
+
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ ui_info = g_variant_new("(isibv)", command_id,
+ text, text_len, user_confirm, icon_id);
+#else
+ ui_info = g_variant_new("(isib)", command_id,
+ text, text_len, user_confirm);
+#endif
+
+ ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_SEND_DTMF,
+ ui_info, slot_id);
+ if (!ret) {
+ int rv;
+
+ err("Failed to launch 'sat-ui', remove the queued data!!!");
+
+ if (!sat_manager_handle_sat_ui_launch_fail(ctx, cp_name, p_ind))
+ dbg("Failed to send Terminal Response!!!");
+
+ rv = sat_manager_remove_cmd_by_id(ctx, command_id);
+ if (!rv)
+ dbg("Failed to de-queue data\n");
+ }
+
+ g_free(text);
+ g_free(dtmf_str);
+
+ return TRUE;
+ }
+
+#if !defined(TIZEN_PLATFORM_USE_QCOM_QMI)
+ telephony_sat_emit_send_dtmf(sat,
+ command_id, text, text_len, dtmf_str, dtmf_str_len);
+#endif
+
+ g_free(text);
+ g_free(dtmf_str);
+ }
+ break;
+
+ case SAT_PROATV_CMD_LAUNCH_BROWSER: {
+ GVariant *launch_browser = NULL;
+ gint command_id = 0;
+ gint browser_launch_type = 0, browser_id = 0;
+ gint url_len = 0, text_len = 0, gateway_proxy_len = 0;
+ gchar *url = NULL;
+ gchar *text = NULL;
+ gchar *gateway_proxy = NULL;
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ GVariant *icon_id = NULL;
+#endif
+
+ launch_browser = sat_manager_launch_browser_noti(ctx, cp_name,
+ (struct tel_sat_launch_browser_tlv *)&p_ind->proactive_ind_data.launch_browser);
+ if (!launch_browser) {
+ dbg("NO launch Browser data");
+ return TRUE;
+ }
+
+ dbg("PROATV_CMD_LAUNCH_BROWSER - type_format: [%s]",
+ g_variant_get_type_string(launch_browser));
+
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ g_variant_get(launch_browser, "(iiisisisi@v)", &command_id,
+ &browser_launch_type, &browser_id, &url, &url_len,
+ &gateway_proxy, &gateway_proxy_len,
+ &text, &text_len, &icon_id);
+#else
+ g_variant_get(launch_browser, "(iiisisisi)", &command_id,
+ &browser_launch_type, &browser_id, &url, &url_len,
+ &gateway_proxy, &gateway_proxy_len,
+ &text, &text_len);
+#endif
+
+ /*
+ * Pop-up is MANDATORY option in Browser case
+ */
+ {
+ GVariant *ui_info = NULL;
+ gboolean user_confirm = TRUE;
+ int ret;
+
+ dbg("Text should be displayed by UI - Launch Browser is displayed!!!");
+
+#if defined(TIZEN_SUPPORT_SAT_ICON)
+ ui_info = g_variant_new("(isibv)", command_id,
+ text, text_len, user_confirm, icon_id);
+#else
+ ui_info = g_variant_new("(isib)", command_id,
+ text, text_len, user_confirm);
+#endif
+
+ ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_LAUNCH_BROWSER,
+ ui_info, slot_id);
+ if (!ret) {
+ int rv;
+
+ err("Failed to launch 'sat-ui', remove the queued data!!!");
+
+ if (!sat_manager_handle_sat_ui_launch_fail(ctx, cp_name, p_ind))
+ dbg("Failed to send Terminal Response!!!");
+
+ rv = sat_manager_remove_cmd_by_id(ctx, command_id);
+ if (!rv)
+ dbg("Failed to de-queue data\n");
+ }
+
+ g_free(url);
+ g_free(text);
+ g_free(gateway_proxy);
+
+ return TRUE;
+ }
+ }
+ break;
+
+ case SAT_PROATV_CMD_PROVIDE_LOCAL_INFO: {
+ GVariant *provide_info = NULL;
+ gint info_type = 0;
+
+ provide_info = sat_manager_provide_local_info_noti(ctx, cp_name,
+ (struct tel_sat_provide_local_info_tlv *)&p_ind->proactive_ind_data.provide_local_info);
+ if (!provide_info) {
+ dbg("NO Provide info data");
+ return TRUE;
+ }
+
+ dbg("PROATV_CMD_PROVIDE_LOCAL_INFO - type_format: [%s]",
+ g_variant_get_type_string(provide_info));
+
+ g_variant_get(provide_info, "(i)", &info_type);
+
+ telephony_sat_emit_provide_local_info(sat, info_type);
+ }
+ break;
+
+ case SAT_PROATV_CMD_LANGUAGE_NOTIFICATION: {
+ GVariant *language_noti = NULL;
+ gint command_id = 0;
+ gint language = 0;
+ gboolean b_specified = FALSE;
+
+ language_noti = sat_manager_language_notification_noti(ctx, cp_name,
+ (struct tel_sat_language_notification_tlv *)&p_ind->proactive_ind_data.language_notification);
+ if (!language_noti) {
+ dbg("NO Language noti data");
+ return TRUE;
+ }
+
+ dbg("PROATV_CMD_LANGUAGE_NOTIFICATION - type_format: [%s]",
+ g_variant_get_type_string(language_noti));
+
+ g_variant_get(language_noti, "(iib)", &command_id,
+ &language, &b_specified);
+
+ sat_manager_update_language(ctx, cp_name, language_noti);
+
+ telephony_sat_emit_language_notification(sat,
+ command_id, language, b_specified);
+ }
+ break;
+
+ default: {
+ gboolean rv = FALSE;
+
+ rv = sat_manager_processing_unsupport_proactive_command(ctx, cp_name,
+ (struct tel_sat_unsupproted_command_tlv *)&p_ind->proactive_ind_data.unsupport_cmd);
+
+ err("Unhandled/Unknown Command type: [0x%x] - Send error TR Result: [%d]", p_ind->cmd_type, rv);
+ }
+ break;
+ }
+ }
+ break;
+
+ default:
+ err("Unhandled/Unknown Notification: [0x%x]", command);
+ break;
+ }
+
+ return TRUE;
+}
+
#include <libxml/tree.h>
#include "generated-code.h"
-#include "common.h"
-#include "sat_manager.h"
+#include "dtapi_common.h"
+#include "dtapi_sat_manager.h"
#include "sat_ui_support/sat_ui_support.h"
#define SAT_DEF_CMD_Q_MAX 10
static const gchar* _convert_sim_lang_to_string(enum tel_sim_language_type lang)
{
dbg("convert lang(%d)", lang);
- switch(lang){
- case SIM_LANG_GERMAN:
- return "de_DE.UTF-8";
- case SIM_LANG_ENGLISH:
- return "en_GB.UTF-8";
- case SIM_LANG_ITALIAN:
- return "it_IT.UTF-8";
- case SIM_LANG_FRENCH:
- return "fr_FR.UTF-8";
- case SIM_LANG_SPANISH:
- return "es_ES.UTF-8";
- case SIM_LANG_DUTCH:
- return "nl_NL.UTF-8";
- case SIM_LANG_SWEDISH:
- return "sv_SE.UTF-8";
- case SIM_LANG_DANISH:
- return "da_DK.UTF-8";
- case SIM_LANG_PORTUGUESE:
- return "pt_PT.UTF-8";
- case SIM_LANG_FINNISH:
- return "fi_FI.UTF-8";
- case SIM_LANG_NORWEGIAN:
- return "nb_NO.UTF-8";
- case SIM_LANG_GREEK:
- return "el_GR.UTF-8";
- case SIM_LANG_TURKISH:
- return "tr_TR.UTF-8";
- case SIM_LANG_HUNGARIAN:
- return "hu_HU.UTF-8";
- case SIM_LANG_POLISH:
- return "pl_PL.UTF-8";
- case SIM_LANG_KOREAN:
- return "ko_KR.UTF-8";
- case SIM_LANG_CHINESE:
- return "zh_CH.UTF-8";
- case SIM_LANG_RUSSIAN:
- return "ru_RU.UTF-8";
- case SIM_LANG_JAPANESE:
- return "ja_JP.UTF-8";
- default:
- return NULL;
- }//end of switch
+ switch (lang) {
+ case SIM_LANG_GERMAN:
+ return "de_DE.UTF-8";
+ case SIM_LANG_ENGLISH:
+ return "en_GB.UTF-8";
+ case SIM_LANG_ITALIAN:
+ return "it_IT.UTF-8";
+ case SIM_LANG_FRENCH:
+ return "fr_FR.UTF-8";
+ case SIM_LANG_SPANISH:
+ return "es_ES.UTF-8";
+ case SIM_LANG_DUTCH:
+ return "nl_NL.UTF-8";
+ case SIM_LANG_SWEDISH:
+ return "sv_SE.UTF-8";
+ case SIM_LANG_DANISH:
+ return "da_DK.UTF-8";
+ case SIM_LANG_PORTUGUESE:
+ return "pt_PT.UTF-8";
+ case SIM_LANG_FINNISH:
+ return "fi_FI.UTF-8";
+ case SIM_LANG_NORWEGIAN:
+ return "nb_NO.UTF-8";
+ case SIM_LANG_GREEK:
+ return "el_GR.UTF-8";
+ case SIM_LANG_TURKISH:
+ return "tr_TR.UTF-8";
+ case SIM_LANG_HUNGARIAN:
+ return "hu_HU.UTF-8";
+ case SIM_LANG_POLISH:
+ return "pl_PL.UTF-8";
+ case SIM_LANG_KOREAN:
+ return "ko_KR.UTF-8";
+ case SIM_LANG_CHINESE:
+ return "zh_CH.UTF-8";
+ case SIM_LANG_RUSSIAN:
+ return "ru_RU.UTF-8";
+ case SIM_LANG_JAPANESE:
+ return "ja_JP.UTF-8";
+ default:
+ return NULL;
+ }
return NULL;
}
{
dbg("convert lang(%s)", lang_str);
- if (g_str_equal(lang_str, "de_DE.UTF-8") == TRUE) {
+ if (g_str_equal(lang_str, "de_DE.UTF-8") == TRUE)
return SIM_LANG_GERMAN;
- }
- else if (g_str_equal(lang_str, "en_GB.UTF-8") == TRUE) {
+ else if (g_str_equal(lang_str, "en_GB.UTF-8") == TRUE)
return SIM_LANG_ENGLISH;
- }
- else if (g_str_equal(lang_str, "it_IT.UTF-8") == TRUE) {
+ else if (g_str_equal(lang_str, "it_IT.UTF-8") == TRUE)
return SIM_LANG_ITALIAN;
- }
- else if (g_str_equal(lang_str, "fr_FR.UTF-8") == TRUE) {
+ else if (g_str_equal(lang_str, "fr_FR.UTF-8") == TRUE)
return SIM_LANG_FRENCH;
- }
- else if (g_str_equal(lang_str, "es_ES.UTF-8") == TRUE) {
+ else if (g_str_equal(lang_str, "es_ES.UTF-8") == TRUE)
return SIM_LANG_SPANISH;
- }
- else if (g_str_equal(lang_str, "nl_NL.UTF-8") == TRUE) {
+ else if (g_str_equal(lang_str, "nl_NL.UTF-8") == TRUE)
return SIM_LANG_DUTCH;
- }
- else if (g_str_equal(lang_str, "sv_SE.UTF-8") == TRUE) {
+ else if (g_str_equal(lang_str, "sv_SE.UTF-8") == TRUE)
return SIM_LANG_SWEDISH;
- }
- else if (g_str_equal(lang_str, "da_DK.UTF-8") == TRUE) {
+ else if (g_str_equal(lang_str, "da_DK.UTF-8") == TRUE)
return SIM_LANG_DANISH;
- }
- else if (g_str_equal(lang_str, "pt_PT.UTF-8") == TRUE) {
+ else if (g_str_equal(lang_str, "pt_PT.UTF-8") == TRUE)
return SIM_LANG_PORTUGUESE;
- }
- else if (g_str_equal(lang_str, "fi_FI.UTF-8") == TRUE) {
+ else if (g_str_equal(lang_str, "fi_FI.UTF-8") == TRUE)
return SIM_LANG_FINNISH;
- }
- else if (g_str_equal(lang_str, "nb_NO.UTF-8") == TRUE) {
+ else if (g_str_equal(lang_str, "nb_NO.UTF-8") == TRUE)
return SIM_LANG_NORWEGIAN;
- }
- else if (g_str_equal(lang_str, "el_GR.UTF-8") == TRUE) {
+ else if (g_str_equal(lang_str, "el_GR.UTF-8") == TRUE)
return SIM_LANG_GREEK;
- }
- else if (g_str_equal(lang_str, "tr_TR.UTF-8") == TRUE) {
+ else if (g_str_equal(lang_str, "tr_TR.UTF-8") == TRUE)
return SIM_LANG_TURKISH;
- }
- else if (g_str_equal(lang_str, "hu_HU.UTF-8") == TRUE) {
+ else if (g_str_equal(lang_str, "hu_HU.UTF-8") == TRUE)
return SIM_LANG_HUNGARIAN;
- }
- else if (g_str_equal(lang_str, "pl_PL.UTF-8") == TRUE) {
+ else if (g_str_equal(lang_str, "pl_PL.UTF-8") == TRUE)
return SIM_LANG_POLISH;
- }
- else if (g_str_equal(lang_str, "ko_KR.UTF-8") == TRUE) {
+ else if (g_str_equal(lang_str, "ko_KR.UTF-8") == TRUE)
return SIM_LANG_KOREAN;
- }
- else if (g_str_equal(lang_str, "zh_CH.UTF-8") == TRUE) {
+ else if (g_str_equal(lang_str, "zh_CH.UTF-8") == TRUE)
return SIM_LANG_CHINESE;
- }
- else if (g_str_equal(lang_str, "ru_RU.UTF-8") == TRUE) {
+ else if (g_str_equal(lang_str, "ru_RU.UTF-8") == TRUE)
return SIM_LANG_RUSSIAN;
- }
- else if (g_str_equal(lang_str, "ja_JP.UTF-8") == TRUE) {
+ else if (g_str_equal(lang_str, "ja_JP.UTF-8") == TRUE)
return SIM_LANG_JAPANESE;
- }
dbg("there is no matched language");
return SIM_LANG_UNSPECIFIED;
sz = strlen(s);
ret = calloc(1, (sz / 2) + 1);
- if (ret == NULL)
+ if (!ret)
return NULL;
dbg("Convert String to Binary!!");
- for (i = 0; i < sz; i += 2) {
+ for (i = 0; i < sz; i += 2)
ret[i / 2] = (char) ((_convert_hex_char_to_int(s[i]) << 4) | _convert_hex_char_to_int(s[i + 1]));
- }
return ret;
}
static unsigned int _get_time_in_ms(struct tel_sat_duration *dr)
{
switch (dr->time_unit) {
- case TIME_UNIT_MINUTES:
- return (unsigned int)dr->time_interval * 60000;
- break;
+ case TIME_UNIT_MINUTES:
+ return (unsigned int)dr->time_interval * 60000;
+ break;
- case TIME_UNIT_SECONDS:
- return (unsigned int)dr->time_interval * 1000;
- break;
+ case TIME_UNIT_SECONDS:
+ return (unsigned int)dr->time_interval * 1000;
+ break;
- case TIME_UNIT_TENTHS_OF_SECONDS:
- return (unsigned int)dr->time_interval * 100;
- break;
+ case TIME_UNIT_TENTHS_OF_SECONDS:
+ return (unsigned int)dr->time_interval * 100;
+ break;
- case TIME_UNIT_RESERVED:
- default:
- return 0; // set default
- break;
+ case TIME_UNIT_RESERVED:
+ default:
+ return 0;
+ break;
}
return 0;
int i;
int local_index = -1;
- for(i =0; i<SAT_DEF_CMD_Q_MAX ; i++) {
- if(sat_queue[i]) {
- dbg("index[%d] is being used",i);
+ for (i = 0; i < SAT_DEF_CMD_Q_MAX; i++) {
+ if (sat_queue[i]) {
+ dbg("index[%d] is being used", i);
cnt++;
}
}
- for(i =0; i<SAT_DEF_CMD_Q_MAX ; i++) {
- if(!sat_queue[i]) {
- dbg("found empty slot [%p] at index [%d]", sat_queue[i] ,i);
+ for (i = 0; i < SAT_DEF_CMD_Q_MAX; i++) {
+ if (!sat_queue[i]) {
+ dbg("found empty slot [%p] at index [%d]", sat_queue[i], i);
local_index = i;
break;
}
item = g_new0(struct sat_manager_queue_data, 1);
- if(!item) {
+ if (!item) {
dbg("[SAT] FAILED TO ALLOC QUEUE ITEM!\n");
return FALSE;
}
memcpy((void*)item, (void*)cmd_obj, sizeof(struct sat_manager_queue_data));
sat_queue[local_index] = item;
- dbg("push data to queue at index[%d], [%p].\n",local_index, item);
+ dbg("push data to queue at index[%d], [%p].\n", local_index, item);
return TRUE;
}
SAT_CMD_Q_CHECK(local_index);
- if(!sat_queue[local_index]) {
+ if (!sat_queue[local_index]) {
dbg("[SAT] sat_queue[%d] is null !!\n", local_index);
return FALSE;
}
item = sat_queue[local_index];
memcpy((void*)cmd_obj, (void*)item, sizeof(struct sat_manager_queue_data));
- dbg("pop data from queue at index[%d],[%p].\n",local_index, item);
+ dbg("pop data from queue at index[%d],[%p].\n", local_index, item);
sat_queue[local_index] = NULL;
g_free(item);
return TRUE;
SAT_CMD_Q_CHECK(local_index);
- if(!sat_queue[local_index]) {
+ if (!sat_queue[local_index]) {
dbg("[SAT] sat_queue[%d] is null !!\n", local_index);
return FALSE;
}
item = sat_queue[local_index];
memcpy((void*)cmd_obj, (void*)item, sizeof(struct sat_manager_queue_data));
- dbg("peek data from queue at index[%d],[%p].\n",local_index, item);
+ dbg("peek data from queue at index[%d],[%p].\n", local_index, item);
return TRUE;
}
{
xmlNode *cur_node = NULL;
xmlNodePtr cur;
- void *xml_doc = NULL,*xml_root_node = NULL;
+ void *xml_doc = NULL, *xml_root_node = NULL;
char *id = NULL;
gboolean ret = FALSE;
cur = xml_root_node;
/* Compare language */
- for(cur_node = cur; cur_node; cur_node = cur_node->next) {
+ for (cur_node = cur; cur_node; cur_node = cur_node->next) {
if (cur_node->type == XML_ELEMENT_NODE) {
id = (char *)xmlGetProp(cur_node, (const xmlChar *)"id");
if (id && g_str_has_prefix(lan, id)) {
int i;
dbg("Entered into queue");
- for(i=0;i<SAT_DEF_CMD_Q_MAX;i++) {
+ for (i = 0; i < SAT_DEF_CMD_Q_MAX; i++) {
struct sat_manager_queue_data * item = sat_queue[i];
- if(item != NULL && !g_strcmp0(cp_name,item->cp_name)) {
+ if (item != NULL && !g_strcmp0(cp_name, item->cp_name)) {
dbg("item[%d]: cmd_type[%d]", i, item->cmd_type);
#if defined(TIZEN_PLATFORM_USE_QCOM_QMI)
- switch(item->cmd_type) {
- case SAT_PROATV_CMD_SEND_SMS:
- case SAT_PROATV_CMD_SEND_SS:
- case SAT_PROATV_CMD_SEND_USSD:
- case SAT_PROATV_CMD_SEND_DTMF: {
- dbg("[SAT] set noti flag");
- item->noti_required = TRUE;
- return;
- } break;
- default:
- break;
+ switch (item->cmd_type) {
+ case SAT_PROATV_CMD_SEND_SMS:
+ case SAT_PROATV_CMD_SEND_SS:
+ case SAT_PROATV_CMD_SEND_USSD:
+ case SAT_PROATV_CMD_SEND_DTMF: {
+ dbg("[SAT] set noti flag");
+ item->noti_required = TRUE;
+ return;
+ } break;
+ default:
+ break;
}
#endif
g_free(item->cp_name);
int id;
id = _get_queue_empty_index();
- if(id < 0) {
+ if (id < 0) {
dbg("Fail to get empty index.\n");
return FALSE;
}
static gboolean sat_manager_check_availiable_event_list(struct tel_sat_setup_event_list_tlv *event_list_tlv)
{
- gboolean rv = TRUE;
+ gboolean rv = FALSE;
int local_index = 0;
+ unsigned char count = event_list_tlv->event_list.event_list_cnt;
+ if(count <= 0)
+ return rv;
- for(local_index = 0; local_index < event_list_tlv->event_list.event_list_cnt; local_index++){
- if(event_list_tlv->event_list.evt_list[local_index] == EVENT_USER_ACTIVITY){
+ /*
+ * event_list will be determined at libtcore (co_sat) accoding to
+ * capabilities of AP and CP.
+ */
+ for (local_index = 0; local_index < count; local_index++) {
+ if (event_list_tlv->event_list.evt_list[local_index] == EVENT_USER_ACTIVITY) {
dbg("do user activity");
- }
- else if(event_list_tlv->event_list.evt_list[local_index] == EVENT_IDLE_SCREEN_AVAILABLE){
+ rv = TRUE;
+ } else if (event_list_tlv->event_list.evt_list[local_index] == EVENT_IDLE_SCREEN_AVAILABLE) {
dbg("do idle screen");
- }
- else if(event_list_tlv->event_list.evt_list[local_index] == EVENT_LANGUAGE_SELECTION){
+ rv = TRUE;
+ } else if (event_list_tlv->event_list.evt_list[local_index] == EVENT_LANGUAGE_SELECTION) {
dbg("do language selection");
- }
- else if(event_list_tlv->event_list.evt_list[local_index] == EVENT_BROWSER_TERMINATION){
+ rv = TRUE;
+ } else if (event_list_tlv->event_list.evt_list[local_index] == EVENT_BROWSER_TERMINATION) {
dbg("do browser termination");
- }
- else if(event_list_tlv->event_list.evt_list[local_index] == EVENT_DATA_AVAILABLE){
+ rv = TRUE;
+#ifdef TIZEN_AP_SUPPORT_BIP
+ } else if (event_list_tlv->event_list.evt_list[local_index] == EVENT_DATA_AVAILABLE) {
dbg("do data available (bip)");
- }
- else if(event_list_tlv->event_list.evt_list[local_index] == EVENT_CHANNEL_STATUS){
+ rv = TRUE;
+ } else if (event_list_tlv->event_list.evt_list[local_index] == EVENT_CHANNEL_STATUS) {
dbg("do channel status (bip)");
- }
- else{
- dbg("unmanaged event (%d)", event_list_tlv->event_list.evt_list[local_index]);
- rv = FALSE;
+ rv = TRUE;
+#endif
+ } else {
+ dbg("unmanaged event by AP (%d)", event_list_tlv->event_list.evt_list[local_index]);
+ rv = TRUE;
}
}
tcore_user_request_set_data(ur, sizeof(struct treq_sat_user_confirmation_data), (void *)conf_data);
rv = tcore_communicator_dispatch_request(comm, ur);
if (rv != TCORE_RETURN_SUCCESS) {
- dbg("fail to send terminal response",rv);
+ dbg("fail to send terminal response", rv);
tcore_user_request_unref(ur);
rv = TCORE_RETURN_FAILURE;
}
tcore_user_request_set_data(ur, sizeof(struct treq_sat_terminal_rsp_data), (void *)tr);
rv = tcore_communicator_dispatch_request(comm, ur);
if (rv != TCORE_RETURN_SUCCESS) {
- dbg("fail to send terminal response",rv);
+ dbg("fail to send terminal response", rv);
tcore_user_request_unref(ur);
rv = TCORE_RETURN_FAILURE;
}
struct sat_manager_queue_data *item;
int local_index = cmd_id;
- if(!sat_queue[local_index]) {
+ if (!sat_queue[local_index]) {
dbg("[SAT] sat_queue[%d] is already null !!\n", local_index);
return FALSE;
}
item = sat_queue[local_index];
- dbg("remove data from queue at index[%d],[%p].\n",local_index, item);
+ dbg("remove data from queue at index[%d],[%p].\n", local_index, item);
sat_queue[local_index] = NULL;
g_free(item->cp_name);
g_free(item);
memset(&main_title, 0 , SAT_ALPHA_ID_LEN_MAX);
plg = tcore_server_find_plugin(ctx->server, cp_name);
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return NULL;
}
continue;
if (g_strcmp0(object->cp_name, cp_name) == 0) {
- if(object->cached_sat_main_menu) {
+ if (object->cached_sat_main_menu) {
dbg("main menu info is updated");
updated = TRUE;
}
}
}
- //check the validation of content
- if(!setup_menu_tlv->menu_item_cnt || !setup_menu_tlv->menu_item[0].text_len){
- //support GCF case 27.22.4.8.1 - 1.1 setup menu
+ /* check the validation of content */
+ if (!setup_menu_tlv->menu_item_cnt || !setup_menu_tlv->menu_item[0].text_len) {
+ /* support GCF case 27.22.4.8.1 - 1.1 setup menu */
dbg("no menu item updated menu(%d)", updated);
tr.terminal_rsp_data.setup_menu.device_id.src = setup_menu_tlv->device_id.dest;
tr.terminal_rsp_data.setup_menu.device_id.dest = setup_menu_tlv->device_id.src;
- if(updated){
+ if (updated)
tr.terminal_rsp_data.setup_menu.result_type = RESULT_SUCCESS;
- }else{
+ else
tr.terminal_rsp_data.setup_menu.result_type = RESULT_BEYOND_ME_CAPABILITIES;
- }
sat_manager_send_terminal_response(ctx->comm, plg, &tr);
- //return NULL;
+ /* return NULL; */
}
menu_present = setup_menu_tlv->command_detail.cmd_qualifier.setup_menu.select_preference;
menu_cnt = setup_menu_tlv->menu_item_cnt;
- //get title
- if(setup_menu_tlv->alpha_id.alpha_data_len)
+ /* get title */
+ if (setup_menu_tlv->alpha_id.alpha_data_len)
tcore_util_convert_string_to_utf8((unsigned char*)&main_title, (unsigned short*)&title_len,
setup_menu_tlv->alpha_id.dcs.a_format,
(unsigned char*)&setup_menu_tlv->alpha_id.alpha_data,
(unsigned short)setup_menu_tlv->alpha_id.alpha_data_len);
- dbg("sat main menu title(%s)",main_title);
+ dbg("sat main menu title(%s)", main_title);
- g_variant_builder_init(&v_builder, G_VARIANT_TYPE ("a(si)"));
+ g_variant_builder_init(&v_builder, G_VARIANT_TYPE("a(si)"));
- //get menu items
- if(!setup_menu_tlv->next_act_ind_list.cnt){
+ /* get menu items */
+ if (!setup_menu_tlv->next_act_ind_list.cnt) {
int local_index = 0;
dbg("setup_menu_tlv->next_act_ind_list.cnt == 0");
- for(local_index = 0; local_index < menu_cnt; local_index++){
+ for (local_index = 0; local_index < menu_cnt; local_index++) {
gushort item_len;
gchar item_str[SAT_ITEM_TEXT_LEN_MAX + 1];
(unsigned char*)&setup_menu_tlv->menu_item[local_index].text,
(unsigned short)setup_menu_tlv->menu_item[local_index].text_len);
- dbg( "index(%d) item_id(%d) item_string(%s)", local_index, setup_menu_tlv->menu_item[local_index].item_id, item_str);
+ dbg("index(%d) item_id(%d) item_string(%s)", local_index, setup_menu_tlv->menu_item[local_index].item_id, item_str);
- //g_variant_builder_add(v_builder, "(sy)", &item_str, setup_menu_tlv->menu_item[index].item_id);
+ /* g_variant_builder_add(v_builder, "(sy)", &item_str, setup_menu_tlv->menu_item[index].item_id); */
g_variant_builder_add(&v_builder, "(si)", item_str, (gint32)(setup_menu_tlv->menu_item[local_index].item_id));
}
- }
- else{
+ } else {
int local_index = 0;
dbg("setup_menu_tlv->next_act_ind_list.cnt != 0");
- for(local_index = 0; local_index < menu_cnt; local_index++){
+ for (local_index = 0; local_index < menu_cnt; local_index++) {
gushort item_len;
gchar item_str[SAT_ITEM_TEXT_LEN_MAX + 1];
(unsigned char*)&setup_menu_tlv->menu_item[local_index].text,
(unsigned short)setup_menu_tlv->menu_item[local_index].text_len);
- dbg( "index(%d) item_id(%d) item_string(%s)", local_index, setup_menu_tlv->menu_item[local_index].item_id, item_str);
+ dbg("index(%d) item_id(%d) item_string(%s)", local_index, setup_menu_tlv->menu_item[local_index].item_id, item_str);
- //g_variant_builder_add(v_builder, "(sy)", g_strdup(item_str), setup_menu_tlv->menu_item[local_index].item_id);
+ /* g_variant_builder_add(v_builder, "(sy)", g_strdup(item_str), setup_menu_tlv->menu_item[local_index].item_id); */
g_variant_builder_add(&v_builder, "(si)", item_str, (gint32)(setup_menu_tlv->menu_item[local_index].item_id));
}
}
menu_items = g_variant_builder_end(&v_builder);
- //enqueue data and generate cmd_id
+ /* enqueue data and generate cmd_id */
memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
q_data.cmd_type = SAT_PROATV_CMD_SETUP_MENU;
q_data.cp_name = g_strdup(cp_name);
memcpy((void*)&(q_data.cmd_data.setupMenuInd), setup_menu_tlv, sizeof(struct tel_sat_setup_menu_tlv));
- if(FALSE == sat_manager_enqueue_cmd(ctx, &q_data)){
+ if (FALSE == sat_manager_enqueue_cmd(ctx, &q_data))
g_free(q_data.cp_name);
- }
command_id = q_data.cmd_id;
#if defined(TIZEN_SUPPORT_SAT_ICON)
/* Icon data extraction */
- g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE ("a(biiiiiis)"));
- if(setup_menu_tlv->icon_id.is_exist) {
+ g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE("a(biiiiiis)"));
+ if (setup_menu_tlv->icon_id.is_exist) {
g_variant_builder_add(&v_builder_icon, "(biiiiiis)", setup_menu_tlv->icon_id.is_exist, setup_menu_tlv->icon_id.icon_qualifer, (gint32) setup_menu_tlv->icon_id.icon_identifier, (gint32) setup_menu_tlv->icon_id.icon_info.width,
(gint32) setup_menu_tlv->icon_id.icon_info.height, setup_menu_tlv->icon_id.icon_info.ics, setup_menu_tlv->icon_id.icon_info.icon_data_len, setup_menu_tlv->icon_id.icon_info.icon_file);
}
icon_id = g_variant_builder_end(&v_builder_icon);
/* Icon list data extraction */
- g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE ("a(biiv)"));
- if(setup_menu_tlv->icon_list.is_exist) {
- g_variant_builder_init(&v_builder_icon_list_data, G_VARIANT_TYPE ("a(iiiiis)"));
- for(local_index= 0; local_index< (int)setup_menu_tlv->icon_list.icon_cnt; local_index++){
+ g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE("a(biiv)"));
+ if (setup_menu_tlv->icon_list.is_exist) {
+ g_variant_builder_init(&v_builder_icon_list_data, G_VARIANT_TYPE("a(iiiiis)"));
+ for (local_index = 0; local_index < (int)setup_menu_tlv->icon_list.icon_cnt; local_index++) {
g_variant_builder_add(&v_builder_icon_list_data, "(iiiiis)", (gint32) setup_menu_tlv->icon_list.icon_id_list[local_index], (gint32) setup_menu_tlv->icon_list.icon_info[local_index].width,
(gint32) setup_menu_tlv->icon_list.icon_info[local_index].height, setup_menu_tlv->icon_list.icon_info[local_index].ics, setup_menu_tlv->icon_list.icon_info[local_index].icon_data_len, setup_menu_tlv->icon_list.icon_info[local_index].icon_file);
}
struct sat_manager_queue_data q_data;
gushort text_len = 0;
- gint command_id = 0, duration= 0, tmp_duration = 0;
+ gint command_id = 0, duration = 0, tmp_duration = 0;
gboolean immediately_rsp = FALSE, high_priority = FALSE, user_rsp_required = FALSE;
gchar text[SAT_TEXT_STRING_LEN_MAX+1];
#if defined(TIZEN_SUPPORT_SAT_ICON)
memset(&text, 0 , SAT_TEXT_STRING_LEN_MAX+1);
plg = tcore_server_find_plugin(ctx->server, cp_name);
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return NULL;
}
- if(!display_text_tlv->text.string_length ||
- (display_text_tlv->text.string_length > 0 && decode_error != TCORE_SAT_SUCCESS)){
+ if (!display_text_tlv->text.string_length ||
+ (display_text_tlv->text.string_length > 0 && decode_error != TCORE_SAT_SUCCESS)) {
struct treq_sat_terminal_rsp_data tr;
dbg("displat text - invalid parameter of TLVs is found!!");
return NULL;
}
- //user resp required & time_duration
- if(display_text_tlv->command_detail.cmd_qualifier.display_text.text_clear_type == TEXT_WAIT_FOR_USER_TO_CLEAR_MSG){
+ /* user resp required & time_duration */
+ if (display_text_tlv->command_detail.cmd_qualifier.display_text.text_clear_type == TEXT_WAIT_FOR_USER_TO_CLEAR_MSG) {
user_rsp_required = TRUE;
duration = SAT_TIME_OUT;
- }
- else{
+ } else {
/* Set by default if duration is not provided. */
duration = TIZEN_SAT_DELAY_TO_CLEAN_MSG;
}
- //immediate response requested
+ /* immediate response requested */
if (display_text_tlv->immediate_response_requested)
immediately_rsp = TRUE;
- //high priority
+ /* high priority */
if (display_text_tlv->command_detail.cmd_qualifier.display_text.text_priority == TEXT_PRIORITY_HIGH)
high_priority = TRUE;
- //get text
- tcore_util_convert_string_to_utf8((unsigned char*) &text, (unsigned short *) &text_len,
- display_text_tlv->text.dcs.a_format,
- (unsigned char*) &display_text_tlv->text.string,
- (unsigned short) display_text_tlv->text.string_length);
- dbg("sat display text(%s)",text);
+ /* get text */
+ tcore_util_convert_string_to_utf8((unsigned char*)&text, (unsigned short *)&text_len,
+ display_text_tlv->text.dcs.a_format,
+ (unsigned char*) &display_text_tlv->text.string,
+ (unsigned short) display_text_tlv->text.string_length);
+ dbg("sat display text(%s)", text);
- //duration
- if(display_text_tlv->duration.time_interval){
+ /* duration */
+ if (display_text_tlv->duration.time_interval)
tmp_duration = _get_time_in_ms(&display_text_tlv->duration);
- }
/* duration is required only when clear message after a delay
- * 27.22.4.1.7.4.2 DISPLAY TEXT ( Variable Timeout )
+ * 27.22.4.1.7.4.2 DISPLAY TEXT (Variable Timeout)
*/
- if(tmp_duration > 0) {
+ if (tmp_duration > 0)
duration = tmp_duration;
- }
- if(immediately_rsp && user_rsp_required)
+ if (immediately_rsp && user_rsp_required)
duration = 0;
dbg("user rsp required(%d), immediately rsp(%d) duration (%d), priority(%d)",
ctx->help_requested = FALSE;
}*/
- //enqueue data and generate cmd_id
+ /* enqueue data and generate cmd_id */
memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
q_data.cmd_type = SAT_PROATV_CMD_DISPLAY_TEXT;
q_data.cp_name = g_strdup(cp_name);
memcpy((void*)&(q_data.cmd_data.displayTextInd), display_text_tlv, sizeof(struct tel_sat_display_text_tlv));
- if(FALSE == sat_manager_enqueue_cmd(ctx, &q_data)){
+ if (FALSE == sat_manager_enqueue_cmd(ctx, &q_data))
g_free(q_data.cp_name);
- }
command_id = q_data.cmd_id;
#if defined(TIZEN_SUPPORT_SAT_ICON)
/* Icon data extraction */
- g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE ("a(biiiiiis)"));
- if(display_text_tlv->icon_id.is_exist) {
+ g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE("a(biiiiiis)"));
+ if (display_text_tlv->icon_id.is_exist) {
g_variant_builder_add(&v_builder_icon, "(biiiiiis)", display_text_tlv->icon_id.is_exist, display_text_tlv->icon_id.icon_qualifer, (gint32) display_text_tlv->icon_id.icon_identifier, (gint32) display_text_tlv->icon_id.icon_info.width,
(gint32) display_text_tlv->icon_id.icon_info.height, display_text_tlv->icon_id.icon_info.ics, display_text_tlv->icon_id.icon_info.icon_data_len, display_text_tlv->icon_id.icon_info.icon_file);
}
memset(&text, 0 , SAT_TEXT_STRING_LEN_MAX+1);
plg = tcore_server_find_plugin(ctx->server, cp_name);
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return NULL;
}
- if(!select_item_tlv->menu_item_cnt || !select_item_tlv->menu_item[0].text_len){
+ if (!select_item_tlv->menu_item_cnt || !select_item_tlv->menu_item[0].text_len) {
struct treq_sat_terminal_rsp_data tr;
dbg("select item - mandatory field does not exist");
return NULL;
}
- // help info
+ /* help info */
help_info = select_item_tlv->command_detail.cmd_qualifier.select_item.help_info;
- if(!select_item_tlv->alpha_id.is_exist){
+ if (!select_item_tlv->alpha_id.is_exist) {
dbg("set the item dcs value to ALPHABET_FORMAT_8BIT_DATA");
select_item_tlv->alpha_id.dcs.a_format = ALPHABET_FORMAT_8BIT_DATA;
}
- // select item text
- if(select_item_tlv->alpha_id.is_exist && select_item_tlv->alpha_id.alpha_data_len > 0)
- tcore_util_convert_string_to_utf8((unsigned char*)&text,(unsigned short *)&text_len,
- select_item_tlv->alpha_id.dcs.a_format,
- (unsigned char*)&select_item_tlv->alpha_id.alpha_data,
- (unsigned short)select_item_tlv->alpha_id.alpha_data_len);
- dbg("select item text(%s)",text);
+ /* select item text */
+ if (select_item_tlv->alpha_id.is_exist && select_item_tlv->alpha_id.alpha_data_len > 0)
+ tcore_util_convert_string_to_utf8((unsigned char*)&text, (unsigned short *)&text_len,
+ select_item_tlv->alpha_id.dcs.a_format,
+ (unsigned char*)&select_item_tlv->alpha_id.alpha_data,
+ (unsigned short)select_item_tlv->alpha_id.alpha_data_len);
+ dbg("select item text(%s)", text);
- //default item id
+ /* default item id */
default_item_id = select_item_tlv->item_identifier.item_identifier;
- dbg( "default item id(%d)", default_item_id);
+ dbg("default item id(%d)", default_item_id);
- //item count
+ /* item count */
menu_cnt = select_item_tlv->menu_item_cnt;
- dbg( "menu item count(%d)", menu_cnt);
+ dbg("menu item count(%d)", menu_cnt);
- //items
- g_variant_builder_init(&v_builder, G_VARIANT_TYPE ("a(iis)"));
- for(local_index= 0; local_index< menu_cnt; local_index++){
+ /* items */
+ g_variant_builder_init(&v_builder, G_VARIANT_TYPE("a(iis)"));
+ for (local_index = 0; local_index < menu_cnt; local_index++) {
gushort item_len;
gchar item_str[SAT_ITEM_TEXT_LEN_MAX + 1];
memset(&item_str, 0 , SAT_ITEM_TEXT_LEN_MAX + 1);
tcore_util_convert_string_to_utf8((unsigned char*) &item_str, (unsigned short *) &item_len,
- select_item_tlv->menu_item[local_index].dcs.a_format,
- (unsigned char*) &select_item_tlv->menu_item[local_index].text,
- (unsigned short) select_item_tlv->menu_item[local_index].text_len);
+ select_item_tlv->menu_item[local_index].dcs.a_format,
+ (unsigned char*) &select_item_tlv->menu_item[local_index].text,
+ (unsigned short) select_item_tlv->menu_item[local_index].text_len);
- dbg( "index(%d) item_id(%d) item_len(%d) item_string(%s)", local_index, select_item_tlv->menu_item[local_index].item_id, item_len, item_str);
+ dbg("index(%d) item_id(%d) item_len(%d) item_string(%s)", local_index, select_item_tlv->menu_item[local_index].item_id, item_len, item_str);
g_variant_builder_add(&v_builder, "(iis)", (gint32)(select_item_tlv->menu_item[local_index].item_id), item_len, item_str);
}
menu_items = g_variant_builder_end(&v_builder);
- // generate command id
+ /* generate command id */
memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
q_data.cmd_type = SAT_PROATV_CMD_SELECT_ITEM;
q_data.cp_name = g_strdup(cp_name);
memcpy((void*)&(q_data.cmd_data.selectItemInd), select_item_tlv, sizeof(struct tel_sat_select_item_tlv));
- if(FALSE == sat_manager_enqueue_cmd(ctx, &q_data)){
+ if (FALSE == sat_manager_enqueue_cmd(ctx, &q_data))
g_free(q_data.cp_name);
- }
command_id = q_data.cmd_id;
#if defined(TIZEN_SUPPORT_SAT_ICON)
/* Icon data extraction */
- g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE ("a(biiiiiis)"));
- if(select_item_tlv->icon_id.is_exist) {
+ g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE("a(biiiiiis)"));
+ if (select_item_tlv->icon_id.is_exist) {
g_variant_builder_add(&v_builder_icon, "(biiiiiis)", select_item_tlv->icon_id.is_exist, select_item_tlv->icon_id.icon_qualifer, (gint32) select_item_tlv->icon_id.icon_identifier, (gint32) select_item_tlv->icon_id.icon_info.width,
(gint32) select_item_tlv->icon_id.icon_info.height, select_item_tlv->icon_id.icon_info.ics, select_item_tlv->icon_id.icon_info.icon_data_len, select_item_tlv->icon_id.icon_info.icon_file);
}
icon_id = g_variant_builder_end(&v_builder_icon);
/* Icon list data extraction */
- g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE ("a(biiv)"));
- if(select_item_tlv->icon_list.is_exist) {
- g_variant_builder_init(&v_builder_icon_list, G_VARIANT_TYPE ("a(iiiiis)"));
- for(local_index= 0; local_index< (int)select_item_tlv->icon_list.icon_cnt; local_index++){
+ g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE("a(biiv)"));
+ if (select_item_tlv->icon_list.is_exist) {
+ g_variant_builder_init(&v_builder_icon_list, G_VARIANT_TYPE("a(iiiiis)"));
+ for (local_index = 0; local_index < (int)select_item_tlv->icon_list.icon_cnt; local_index++) {
g_variant_builder_add(&v_builder_icon_list, "(iiiiis)", (gint32) select_item_tlv->icon_list.icon_id_list[local_index], (gint32) select_item_tlv->icon_list.icon_info[local_index].width,
(gint32) select_item_tlv->icon_list.icon_info[local_index].height, select_item_tlv->icon_list.icon_info[local_index].ics, select_item_tlv->icon_list.icon_info[local_index].icon_data_len, select_item_tlv->icon_list.icon_info[local_index].icon_file);
}
memset(&text, 0 , SAT_TEXT_STRING_LEN_MAX+1);
plg = tcore_server_find_plugin(ctx->server, cp_name);
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return NULL;
}
- if(!get_inkey_tlv->text.string_length ||
- (get_inkey_tlv->text.string_length > 0 && decode_error != TCORE_SAT_SUCCESS)){
+ if (!get_inkey_tlv->text.string_length ||
+ (get_inkey_tlv->text.string_length > 0 && decode_error != TCORE_SAT_SUCCESS)) {
struct treq_sat_terminal_rsp_data tr;
dbg("get inkey - invalid parameter of TLVs is found!!");
return NULL;
}
- //key type
+ /* key type */
key_type = get_inkey_tlv->command_detail.cmd_qualifier.get_inkey.inkey_type;
- //time duration
+ /* time duration */
duration = SAT_TIME_OUT;
tmp_duration = _get_time_in_ms(&get_inkey_tlv->duration);
if (tmp_duration > 0)
duration = tmp_duration;
- //input mode
+ /* input mode */
input_character_mode = get_inkey_tlv->command_detail.cmd_qualifier.get_inkey.alphabet_type;
- //numeric
+ /* numeric */
b_numeric = !get_inkey_tlv->command_detail.cmd_qualifier.get_inkey.alphabet_set;
- //help info
+ /* help info */
b_help_info = get_inkey_tlv->command_detail.cmd_qualifier.get_inkey.help_info;
- //text & text len
- tcore_util_convert_string_to_utf8((unsigned char*)&text,(unsigned short *)&text_len,
- get_inkey_tlv->text.dcs.a_format ,
- (unsigned char*)&get_inkey_tlv->text.string,
- (unsigned short)get_inkey_tlv->text.string_length);
+ /* text & text len */
+ tcore_util_convert_string_to_utf8((unsigned char*)&text, (unsigned short *)&text_len,
+ get_inkey_tlv->text.dcs.a_format ,
+ (unsigned char*)&get_inkey_tlv->text.string,
+ (unsigned short)get_inkey_tlv->text.string_length);
- dbg("get inkey text(%s)",text);
+ dbg("get inkey text(%s)", text);
if (get_inkey_tlv->command_detail.cmd_qualifier.get_inkey.immediate_rsp_required) {
dbg("get_inkey immediate_rsp_require is TRUE");
- //Send TR if UI display success
+ /* Send TR if UI display success */
}
- //enqueue data and generate cmd_id
+ /* enqueue data and generate cmd_id */
memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
q_data.cmd_type = SAT_PROATV_CMD_GET_INKEY;
q_data.cp_name = g_strdup(cp_name);
memcpy((void*)&(q_data.cmd_data.getInkeyInd), get_inkey_tlv, sizeof(struct tel_sat_get_inkey_tlv));
- if(FALSE == sat_manager_enqueue_cmd(ctx, &q_data)){
+ if (FALSE == sat_manager_enqueue_cmd(ctx, &q_data))
g_free(q_data.cp_name);
- }
command_id = q_data.cmd_id;
#if defined(TIZEN_SUPPORT_SAT_ICON)
/* Icon data extraction */
- g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE ("a(biiiiiis)"));
- if(get_inkey_tlv->icon_id.is_exist) {
+ g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE("a(biiiiiis)"));
+ if (get_inkey_tlv->icon_id.is_exist) {
g_variant_builder_add(&v_builder_icon, "(biiiiiis)", get_inkey_tlv->icon_id.is_exist, get_inkey_tlv->icon_id.icon_qualifer, (gint32) get_inkey_tlv->icon_id.icon_identifier, (gint32) get_inkey_tlv->icon_id.icon_info.width,
(gint32) get_inkey_tlv->icon_id.icon_info.height, get_inkey_tlv->icon_id.icon_info.ics, get_inkey_tlv->icon_id.icon_info.icon_data_len, get_inkey_tlv->icon_id.icon_info.icon_file);
}
memset(&def_text, 0 , SAT_TEXT_STRING_LEN_MAX+1);
plg = tcore_server_find_plugin(ctx->server, cp_name);
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return NULL;
}
-#if GCF //disable the text length prb for GCF
- if(
+#if GCF /* disable the text length prb for GCF */
+ if (
(get_input_tlv->text.string_length > 0 && decode_error != TCORE_SAT_SUCCESS) ||
- (!get_input_tlv->rsp_len.max) || (get_input_tlv->rsp_len.min > get_input_tlv->rsp_len.max)){
+ (!get_input_tlv->rsp_len.max) || (get_input_tlv->rsp_len.min > get_input_tlv->rsp_len.max)) {
#else
- if(!get_input_tlv->text.string_length ||
+ if (!get_input_tlv->text.string_length ||
(get_input_tlv->text.string_length > 0 && decode_error != TCORE_SAT_SUCCESS) ||
- (!get_input_tlv->rsp_len.max) || (get_input_tlv->rsp_len.min > get_input_tlv->rsp_len.max)){
+ (!get_input_tlv->rsp_len.max) || (get_input_tlv->rsp_len.min > get_input_tlv->rsp_len.max)) {
#endif
struct treq_sat_terminal_rsp_data tr;
return NULL;
}
- dbg( "[SAT] is SMS7 packing required [%d]",get_input_tlv->command_detail.cmd_qualifier.get_input.user_input_unpacked_format);
+ dbg("[SAT] is SMS7 packing required [%d]", get_input_tlv->command_detail.cmd_qualifier.get_input.user_input_unpacked_format);
- //input mode
+ /* input mode */
input_character_mode = get_input_tlv->command_detail.cmd_qualifier.get_input.alphabet_type;
- //numeric
+ /* numeric */
b_numeric = !get_input_tlv->command_detail.cmd_qualifier.get_input.alphabet_set;
- //help info
+ /* help info */
b_help_info = get_input_tlv->command_detail.cmd_qualifier.get_input.help_info;
- //echo input
+ /* echo input */
b_echo_input = get_input_tlv->command_detail.cmd_qualifier.get_input.me_echo_user_input;
dbg("numeric (%d), help info(%d), echo input(%d)", b_numeric, b_help_info, b_echo_input);
- //text & text len
- if(get_input_tlv->text.string_length){
- tcore_util_convert_string_to_utf8((unsigned char*)&text,(unsigned short *)&text_len,
- get_input_tlv->text.dcs.a_format ,
- (unsigned char*)&get_input_tlv->text.string,
- (unsigned short)get_input_tlv->text.string_length);
- dbg("get input text(%s)",text);
+ /* text & text len */
+ if (get_input_tlv->text.string_length) {
+ tcore_util_convert_string_to_utf8((unsigned char*)&text, (unsigned short *)&text_len,
+ get_input_tlv->text.dcs.a_format ,
+ (unsigned char*)&get_input_tlv->text.string,
+ (unsigned short)get_input_tlv->text.string_length);
+ dbg("get input text(%s)", text);
}
- //response length min & max
+ /* response length min & max */
rsp_len_min = get_input_tlv->rsp_len.min;
rsp_len_max = get_input_tlv->rsp_len.max;
/* 27.22.4.3.4 Expected Seq.4.2 */
- if(input_character_mode == INPUT_ALPHABET_TYPE_UCS2 && rsp_len_max > SAT_USC2_INPUT_LEN_MAX)
+ if (input_character_mode == INPUT_ALPHABET_TYPE_UCS2 && rsp_len_max > SAT_USC2_INPUT_LEN_MAX)
rsp_len_max = SAT_USC2_INPUT_LEN_MAX;
- //default text & default text len
- if(get_input_tlv->default_text.string_length){
+ /* default text & default text len */
+ if (get_input_tlv->default_text.string_length) {
int temp_len = get_input_tlv->default_text.string_length;
- if(temp_len > rsp_len_max) {
+ if (temp_len > rsp_len_max) {
dbg("get input def_text_len(%d) is larger than rsp_len_max(%d)", temp_len, rsp_len_max);
get_input_tlv->default_text.string_length = rsp_len_max;
}
- tcore_util_convert_string_to_utf8((unsigned char*)&def_text,(unsigned short *)&def_text_len,
- get_input_tlv->default_text.dcs.a_format ,
- (unsigned char*)&get_input_tlv->default_text.string,
- (unsigned short)get_input_tlv->default_text.string_length);
- dbg("get input default text(%s)",def_text);
+ tcore_util_convert_string_to_utf8((unsigned char*)&def_text, (unsigned short *)&def_text_len,
+ get_input_tlv->default_text.dcs.a_format ,
+ (unsigned char*)&get_input_tlv->default_text.string,
+ (unsigned short)get_input_tlv->default_text.string_length);
+ dbg("get input default text(%s)", def_text);
}
- //enqueue data and generate cmd_id
+ /* enqueue data and generate cmd_id */
memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
q_data.cmd_type = SAT_PROATV_CMD_GET_INPUT;
q_data.cp_name = g_strdup(cp_name);
memcpy((void*)&(q_data.cmd_data.getInputInd), get_input_tlv, sizeof(struct tel_sat_get_input_tlv));
- if(FALSE == sat_manager_enqueue_cmd(ctx, &q_data)){
+ if (FALSE == sat_manager_enqueue_cmd(ctx, &q_data))
g_free(q_data.cp_name);
- }
command_id = q_data.cmd_id;
#if defined(TIZEN_SUPPORT_SAT_ICON)
/* Icon data extraction */
- g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE ("a(biiiiiis)"));
- if(get_input_tlv->icon_id.is_exist) {
+ g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE("a(biiiiiis)"));
+ if (get_input_tlv->icon_id.is_exist) {
g_variant_builder_add(&v_builder_icon, "(biiiiiis)", get_input_tlv->icon_id.is_exist, get_input_tlv->icon_id.icon_qualifer, (gint32) get_input_tlv->icon_id.icon_identifier, (gint32) get_input_tlv->icon_id.icon_info.width,
(gint32) get_input_tlv->icon_id.icon_info.height, get_input_tlv->icon_id.icon_info.ics, get_input_tlv->icon_id.icon_info.icon_data_len, get_input_tlv->icon_id.icon_info.icon_file);
}
memset(&text, 0 , SAT_TEXT_STRING_LEN_MAX+1);
plg = tcore_server_find_plugin(ctx->server, cp_name);
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return NULL;
}
- //text and text len
- if( play_tone_tlv->alpha_id.is_exist && play_tone_tlv->alpha_id.alpha_data_len){
- tcore_util_convert_string_to_utf8((unsigned char*)&text,(unsigned short *)&text_len,
- play_tone_tlv->alpha_id.dcs.a_format,
- (unsigned char*)&play_tone_tlv->alpha_id.alpha_data,
- (unsigned short)play_tone_tlv->alpha_id.alpha_data_len);
- dbg("play tone ui display text (%s)",text);
+ /* text and text len */
+ if (play_tone_tlv->alpha_id.is_exist && play_tone_tlv->alpha_id.alpha_data_len) {
+ tcore_util_convert_string_to_utf8((unsigned char*)&text, (unsigned short *)&text_len,
+ play_tone_tlv->alpha_id.dcs.a_format,
+ (unsigned char*)&play_tone_tlv->alpha_id.alpha_data,
+ (unsigned short)play_tone_tlv->alpha_id.alpha_data_len);
+ dbg("play tone ui display text (%s)", text);
}
- //tone type
+ /* tone type */
tone_type = play_tone_tlv->tone.tone_type;
- //time duration
+ /* time duration */
duration = SAT_TIME_OUT;
tmp_duration = _get_time_in_ms(&play_tone_tlv->duration);
if (tmp_duration > 0)
duration = tmp_duration;
- //enqueue data and generate cmd_id
+ /* enqueue data and generate cmd_id */
memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
q_data.cmd_type = SAT_PROATV_CMD_PLAY_TONE;
q_data.cp_name = g_strdup(cp_name);
memcpy((void*)&(q_data.cmd_data.play_tone), play_tone_tlv, sizeof(struct tel_sat_play_tone_tlv));
- if(FALSE == sat_manager_enqueue_cmd(ctx, &q_data)){
+ if (FALSE == sat_manager_enqueue_cmd(ctx, &q_data))
g_free(q_data.cp_name);
- }
command_id = q_data.cmd_id;
#if defined(TIZEN_SUPPORT_SAT_ICON)
/* Icon data extraction */
- g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE ("a(biiiiiis)"));
- if(play_tone_tlv->icon_id.is_exist) {
+ g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE("a(biiiiiis)"));
+ if (play_tone_tlv->icon_id.is_exist) {
g_variant_builder_add(&v_builder_icon, "(biiiiiis)", play_tone_tlv->icon_id.is_exist, play_tone_tlv->icon_id.icon_qualifer, (gint32) play_tone_tlv->icon_id.icon_identifier, (gint32) play_tone_tlv->icon_id.icon_info.width,
(gint32) play_tone_tlv->icon_id.icon_info.height, play_tone_tlv->icon_id.icon_info.ics, play_tone_tlv->icon_id.icon_info.icon_data_len, play_tone_tlv->icon_id.icon_info.icon_file);
}
int local_index = 0;
gint command_id = 0, ton = 0, npi = 0, tpdu_type = 0;
gboolean b_packing_required = FALSE;
- gushort text_len = 0, number_len = 0, tpdu_data_len= 0;
+ gushort text_len = 0, number_len = 0, tpdu_data_len = 0;
gchar text[SAT_TEXT_STRING_LEN_MAX], dialling_number[SAT_DIALING_NUMBER_LEN_MAX];
GVariantBuilder builder;
GVariant *tpdu_data = NULL;
memset(&dialling_number, 0 , SAT_DIALING_NUMBER_LEN_MAX);
plg = tcore_server_find_plugin(ctx->server, cp_name);
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return NULL;
}
- //text and text len
- if( send_sms_tlv->alpha_id.is_exist && send_sms_tlv->alpha_id.alpha_data_len){
- tcore_util_convert_string_to_utf8((unsigned char*)&text,(unsigned short *)&text_len,
- send_sms_tlv->alpha_id.dcs.a_format,
- (unsigned char*)&send_sms_tlv->alpha_id.alpha_data,
- (unsigned short)send_sms_tlv->alpha_id.alpha_data_len);
- dbg("send sms ui display text (%s)",text);
- }
- else{
- memcpy(text,"",1);
+ /* text and text len */
+ if (send_sms_tlv->alpha_id.is_exist && send_sms_tlv->alpha_id.alpha_data_len) {
+ tcore_util_convert_string_to_utf8((unsigned char*)&text, (unsigned short *)&text_len,
+ send_sms_tlv->alpha_id.dcs.a_format,
+ (unsigned char*)&send_sms_tlv->alpha_id.alpha_data,
+ (unsigned short)send_sms_tlv->alpha_id.alpha_data_len);
+ dbg("send sms ui display text (%s)", text);
+ } else {
+ memcpy(text, "", 1);
text_len = 0;
}
- //packing required
+ /* packing required */
b_packing_required = send_sms_tlv->command_detail.cmd_qualifier.send_sms.packing_by_me_required;
- //address : ton, npi, dialling number, number len
+ /* address : ton, npi, dialling number, number len */
ton = send_sms_tlv->address.ton;
npi = send_sms_tlv->address.npi;
number_len = send_sms_tlv->address.dialing_number_len;
memcpy(dialling_number, send_sms_tlv->address.dialing_number, SAT_DIALING_NUMBER_LEN_MAX);
- //tpdu data : type, data, data len
+ /* tpdu data : type, data, data len */
tpdu_type = send_sms_tlv->sms_tpdu.tpdu_type;
tpdu_data_len = send_sms_tlv->sms_tpdu.data_len;
- g_variant_builder_init(&builder, G_VARIANT_TYPE ("ay"));
- for (local_index= 0; local_index < tpdu_data_len; local_index++) {
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("ay"));
+ for (local_index = 0; local_index < tpdu_data_len; local_index++)
g_variant_builder_add(&builder, "y", send_sms_tlv->sms_tpdu.data[local_index]);
- }
tpdu_data = g_variant_builder_end(&builder);
- //enqueue data and generate cmd_id
+ /* enqueue data and generate cmd_id */
memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
q_data.cmd_type = SAT_PROATV_CMD_SEND_SMS;
q_data.cp_name = g_strdup(cp_name);
memcpy((void*)&(q_data.cmd_data.sendSMSInd), send_sms_tlv, sizeof(struct tel_sat_send_sms_tlv));
- if(FALSE == sat_manager_enqueue_cmd(ctx, &q_data)){
+ if (FALSE == sat_manager_enqueue_cmd(ctx, &q_data))
g_free(q_data.cp_name);
- }
command_id = q_data.cmd_id;
#if defined(TIZEN_SUPPORT_SAT_ICON)
/* Icon data extraction */
- g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE ("a(biiiiiis)"));
- if(send_sms_tlv->icon_id.is_exist) {
+ g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE("a(biiiiiis)"));
+ if (send_sms_tlv->icon_id.is_exist) {
g_variant_builder_add(&v_builder_icon, "(biiiiiis)", send_sms_tlv->icon_id.is_exist, send_sms_tlv->icon_id.icon_qualifer, (gint32) send_sms_tlv->icon_id.icon_identifier, (gint32) send_sms_tlv->icon_id.icon_info.width,
(gint32) send_sms_tlv->icon_id.icon_info.height, send_sms_tlv->icon_id.icon_info.ics, send_sms_tlv->icon_id.icon_info.icon_data_len, send_sms_tlv->icon_id.icon_info.icon_file);
}
memset(&ss_string, 0 , SAT_SS_STRING_LEN_MAX);
plg = tcore_server_find_plugin(ctx->server, cp_name);
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return NULL;
}
- if(!send_ss_tlv->alpha_id.is_exist &&
- (send_ss_tlv->icon_id.is_exist && send_ss_tlv->icon_id.icon_qualifer != ICON_QUALI_SELF_EXPLANATORY)){
+ if (!send_ss_tlv->alpha_id.is_exist &&
+ (send_ss_tlv->icon_id.is_exist && send_ss_tlv->icon_id.icon_qualifer != ICON_QUALI_SELF_EXPLANATORY)) {
struct treq_sat_terminal_rsp_data tr;
dbg("no alpha id and no self explanatory");
return NULL;
}
- //text and text len
- if( send_ss_tlv->alpha_id.is_exist && send_ss_tlv->alpha_id.alpha_data_len){
- tcore_util_convert_string_to_utf8((unsigned char*)&text,(unsigned short *)&text_len,
- send_ss_tlv->alpha_id.dcs.a_format,
- (unsigned char*)&send_ss_tlv->alpha_id.alpha_data,
- (unsigned short)send_ss_tlv->alpha_id.alpha_data_len);
- dbg("send ss ui display text (%s)",text);
+ /* text and text len */
+ if (send_ss_tlv->alpha_id.is_exist && send_ss_tlv->alpha_id.alpha_data_len) {
+ tcore_util_convert_string_to_utf8((unsigned char*)&text, (unsigned short *)&text_len,
+ send_ss_tlv->alpha_id.dcs.a_format,
+ (unsigned char*)&send_ss_tlv->alpha_id.alpha_data,
+ (unsigned short)send_ss_tlv->alpha_id.alpha_data_len);
+ dbg("send ss ui display text (%s)", text);
}
- //ss string: ton, npi, ss string len, ss string
+ /* ss string: ton, npi, ss string len, ss string */
ton = send_ss_tlv->ss_string.ton;
npi = send_ss_tlv->ss_string.npi;
ss_str_len = send_ss_tlv->ss_string.string_len;
memcpy(ss_string, send_ss_tlv->ss_string.ss_string, SAT_SS_STRING_LEN_MAX);
- if(!ss_str_len || (ss_str_len > SAT_SS_STRING_LEN_MAX) ){
+ if (!ss_str_len || (ss_str_len > SAT_SS_STRING_LEN_MAX)) {
struct treq_sat_terminal_rsp_data tr;
dbg("no ss string");
return NULL;
}
- //enqueue data and generate cmd_id
+ /* enqueue data and generate cmd_id */
memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
q_data.cmd_type = SAT_PROATV_CMD_SEND_SS;
q_data.cp_name = g_strdup(cp_name);
memcpy((void*)&(q_data.cmd_data.send_ss), send_ss_tlv, sizeof(struct tel_sat_send_ss_tlv));
- if(FALSE == sat_manager_enqueue_cmd(ctx, &q_data)){
+ if (FALSE == sat_manager_enqueue_cmd(ctx, &q_data))
g_free(q_data.cp_name);
- }
command_id = q_data.cmd_id;
#if defined(TIZEN_SUPPORT_SAT_ICON)
/* Icon data extraction */
- g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE ("a(biiiiiis)"));
- if(send_ss_tlv->icon_id.is_exist) {
+ g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE("a(biiiiiis)"));
+ if (send_ss_tlv->icon_id.is_exist) {
g_variant_builder_add(&v_builder_icon, "(biiiiiis)", send_ss_tlv->icon_id.is_exist, send_ss_tlv->icon_id.icon_qualifer, (gint32) send_ss_tlv->icon_id.icon_identifier, (gint32) send_ss_tlv->icon_id.icon_info.width,
(gint32) send_ss_tlv->icon_id.icon_info.height, send_ss_tlv->icon_id.icon_info.ics, send_ss_tlv->icon_id.icon_info.icon_data_len, send_ss_tlv->icon_id.icon_info.icon_file);
}
memset(&ussd_string, 0 , SAT_USSD_STRING_LEN_MAX);
plg = tcore_server_find_plugin(ctx->server, cp_name);
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return NULL;
}
- if(!send_ussd_tlv->alpha_id.is_exist &&
- (send_ussd_tlv->icon_id.is_exist && send_ussd_tlv->icon_id.icon_qualifer != ICON_QUALI_SELF_EXPLANATORY)){
+ if (!send_ussd_tlv->alpha_id.is_exist &&
+ (send_ussd_tlv->icon_id.is_exist && send_ussd_tlv->icon_id.icon_qualifer != ICON_QUALI_SELF_EXPLANATORY)) {
struct treq_sat_terminal_rsp_data tr;
dbg("no alpha id and no self explanatory");
return NULL;
}
- //text and text len
- if( send_ussd_tlv->alpha_id.is_exist && send_ussd_tlv->alpha_id.alpha_data_len){
- tcore_util_convert_string_to_utf8((unsigned char*)&text,(unsigned short *)&text_len,
- send_ussd_tlv->alpha_id.dcs.a_format,
- (unsigned char*)&send_ussd_tlv->alpha_id.alpha_data,
- (unsigned short)send_ussd_tlv->alpha_id.alpha_data_len);
- dbg("send ussd ui display text (%s)",text);
+ /* text and text len */
+ if (send_ussd_tlv->alpha_id.is_exist && send_ussd_tlv->alpha_id.alpha_data_len) {
+ tcore_util_convert_string_to_utf8((unsigned char*)&text, (unsigned short *)&text_len,
+ send_ussd_tlv->alpha_id.dcs.a_format,
+ (unsigned char*)&send_ussd_tlv->alpha_id.alpha_data,
+ (unsigned short)send_ussd_tlv->alpha_id.alpha_data_len);
+ dbg("send ussd ui display text (%s)", text);
}
- //ussd string
+ /* ussd string */
dcs = send_ussd_tlv->ussd_string.dsc.raw_dcs;
- tcore_util_convert_string_to_utf8((unsigned char*)&ussd_string,(unsigned short *)&ussd_str_len,
- send_ussd_tlv->ussd_string.dsc.a_format,
- (unsigned char*)&send_ussd_tlv->ussd_string.ussd_string,
- (unsigned short)send_ussd_tlv->ussd_string.string_len);
+ tcore_util_convert_string_to_utf8((unsigned char*)&ussd_string, (unsigned short *)&ussd_str_len,
+ send_ussd_tlv->ussd_string.dsc.a_format,
+ (unsigned char*)&send_ussd_tlv->ussd_string.ussd_string,
+ (unsigned short)send_ussd_tlv->ussd_string.string_len);
- if(!ussd_str_len || (ussd_str_len > SAT_USSD_STRING_LEN_MAX) ){
+ if (!ussd_str_len || (ussd_str_len > SAT_USSD_STRING_LEN_MAX)) {
struct treq_sat_terminal_rsp_data tr;
dbg("no ss string");
return NULL;
}
- //enqueue data and generate cmd_id
+ /* enqueue data and generate cmd_id */
memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
q_data.cmd_type = SAT_PROATV_CMD_SEND_USSD;
q_data.cp_name = g_strdup(cp_name);
memcpy((void*)&(q_data.cmd_data.send_ussd), send_ussd_tlv, sizeof(struct tel_sat_send_ussd_tlv));
- if(FALSE == sat_manager_enqueue_cmd(ctx, &q_data)){
+ if (FALSE == sat_manager_enqueue_cmd(ctx, &q_data))
g_free(q_data.cp_name);
- }
command_id = q_data.cmd_id;
#if defined(TIZEN_SUPPORT_SAT_ICON)
/* Icon data extraction */
- g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE ("a(biiiiiis)"));
- if(send_ussd_tlv->icon_id.is_exist) {
+ g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE("a(biiiiiis)"));
+ if (send_ussd_tlv->icon_id.is_exist) {
g_variant_builder_add(&v_builder_icon, "(biiiiiis)", send_ussd_tlv->icon_id.is_exist, send_ussd_tlv->icon_id.icon_qualifer, (gint32) send_ussd_tlv->icon_id.icon_identifier, (gint32) send_ussd_tlv->icon_id.icon_info.width,
(gint32) send_ussd_tlv->icon_id.icon_info.height, send_ussd_tlv->icon_id.icon_info.ics, send_ussd_tlv->icon_id.icon_info.icon_data_len, send_ussd_tlv->icon_id.icon_info.icon_file);
}
memset(&tr, 0, sizeof(struct treq_sat_terminal_rsp_data));
plg = tcore_server_find_plugin(ctx->server, cp_name);
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return NULL;
}
- if(setup_call_tlv->duration.time_interval > 0)
- {
+ if (setup_call_tlv->duration.time_interval > 0) {
dbg("[SAT] redial is not supported.\n");
tr.terminal_rsp_data.setup_call.result_type = RESULT_BEYOND_ME_CAPABILITIES;
goto SEND_TR;
}
- //check for subaddress field
- if(setup_call_tlv->subaddress.subaddress_len > 0)
- {
+ /* check for subaddress field */
+ if (setup_call_tlv->subaddress.subaddress_len > 0) {
dbg("[SAT] Sub address is not supported > 0)");
tr.terminal_rsp_data.setup_call.result_type = RESULT_BEYOND_ME_CAPABILITIES;
goto SEND_TR;
return NULL;
}
- if(setup_call_tlv->command_detail.cmd_qualifier.setup_call.setup_call == SETUP_CALL_IF_ANOTHER_CALL_NOT_BUSY ||
- setup_call_tlv->command_detail.cmd_qualifier.setup_call.setup_call == SETUP_CALL_IF_ANOTHER_CALL_NOT_BUSY_WITH_REDIAL)
- {
- GSList *co_list = NULL;
+ if (setup_call_tlv->command_detail.cmd_qualifier.setup_call.setup_call == SETUP_CALL_IF_ANOTHER_CALL_NOT_BUSY ||
+ setup_call_tlv->command_detail.cmd_qualifier.setup_call.setup_call == SETUP_CALL_IF_ANOTHER_CALL_NOT_BUSY_WITH_REDIAL) {
CoreObject *co_call = NULL;
int total_call_cnt = 0;
- co_list = tcore_plugin_get_core_objects_bytype(plg, CORE_OBJECT_TYPE_CALL);
- if ( !co_list ) {
- dbg("[ error ] co_list : 0");
- tr.terminal_rsp_data.setup_call.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- goto SEND_TR;
- }
-
- co_call = (CoreObject *)co_list->data;
- g_slist_free(co_list);
+ co_call = tcore_plugin_ref_core_object(plg, CORE_OBJECT_TYPE_CALL);
total_call_cnt = tcore_call_object_total_length(co_call);
- if (total_call_cnt){
+ if (total_call_cnt) {
dbg("[SAT] Another call in progress hence rejecting. total_call_cnt: %d", total_call_cnt);
tr.terminal_rsp_data.setup_call.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
tr.terminal_rsp_data.setup_call.me_problem_type = ME_PROBLEM_ME_BUSY_ON_CALL;
}
}
- //call type
+ /* call type */
call_type = setup_call_tlv->command_detail.cmd_qualifier.setup_call.setup_call;
- //call display data
- if(setup_call_tlv->call_setup_alpha_id.alpha_data_len != 0){
- tcore_util_convert_string_to_utf8((unsigned char*)&text,(unsigned short *)&text_len,
- setup_call_tlv->call_setup_alpha_id.dcs.a_format,
- (unsigned char*)&setup_call_tlv->call_setup_alpha_id.alpha_data,
- (unsigned short)setup_call_tlv->call_setup_alpha_id.alpha_data_len);
+ /* call display data */
+ if (setup_call_tlv->call_setup_alpha_id.alpha_data_len != 0) {
+ tcore_util_convert_string_to_utf8((unsigned char*)&text, (unsigned short *)&text_len,
+ setup_call_tlv->call_setup_alpha_id.dcs.a_format,
+ (unsigned char*)&setup_call_tlv->call_setup_alpha_id.alpha_data,
+ (unsigned short)setup_call_tlv->call_setup_alpha_id.alpha_data_len);
}
- dbg("setup call display text (%s)",text);
+ dbg("setup call display text (%s)", text);
- if(setup_call_tlv->user_confirm_alpha_id.alpha_data_len != 0){
- tcore_util_convert_string_to_utf8((unsigned char*)&confirm_text,(unsigned short *)&confirm_text_len,
- setup_call_tlv->user_confirm_alpha_id.dcs.a_format,
- (unsigned char*)&setup_call_tlv->user_confirm_alpha_id.alpha_data,
- (unsigned short)setup_call_tlv->user_confirm_alpha_id.alpha_data_len);
+ if (setup_call_tlv->user_confirm_alpha_id.alpha_data_len != 0) {
+ tcore_util_convert_string_to_utf8((unsigned char*)&confirm_text, (unsigned short *)&confirm_text_len,
+ setup_call_tlv->user_confirm_alpha_id.dcs.a_format,
+ (unsigned char*)&setup_call_tlv->user_confirm_alpha_id.alpha_data,
+ (unsigned short)setup_call_tlv->user_confirm_alpha_id.alpha_data_len);
}
- //call number
- if(setup_call_tlv->address.ton == TON_INTERNATIONAL){
+ /* call number */
+ if (setup_call_tlv->address.ton == TON_INTERNATIONAL) {
call_number[0] = '+';
- memcpy(&call_number[1],setup_call_tlv->address.dialing_number, setup_call_tlv->address.dialing_number_len);
- }
- else{
- memcpy(call_number,setup_call_tlv->address.dialing_number, setup_call_tlv->address.dialing_number_len);
+ memcpy(&call_number[1], setup_call_tlv->address.dialing_number, setup_call_tlv->address.dialing_number_len);
+ } else {
+ memcpy(call_number, setup_call_tlv->address.dialing_number, setup_call_tlv->address.dialing_number_len);
}
- dbg("setup call call number: origin(%s), final(%s)",setup_call_tlv->address.dialing_number, call_number);
+ dbg("setup call call number: origin(%s), final(%s)", setup_call_tlv->address.dialing_number, call_number);
- //duration
- if(setup_call_tlv->duration.time_interval > 0)
+ /* duration */
+ if (setup_call_tlv->duration.time_interval > 0)
duration = _get_time_in_ms(&setup_call_tlv->duration);
- //enqueue data and generate cmd_id
+ /* enqueue data and generate cmd_id */
memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
q_data.cmd_type = SAT_PROATV_CMD_SETUP_CALL;
q_data.cp_name = g_strdup(cp_name);
memcpy((void*)&(q_data.cmd_data.setup_call), setup_call_tlv, sizeof(struct tel_sat_setup_call_tlv));
- if(FALSE == sat_manager_enqueue_cmd(ctx, &q_data)){
+ if (FALSE == sat_manager_enqueue_cmd(ctx, &q_data))
g_free(q_data.cp_name);
- }
command_id = q_data.cmd_id;
#if defined(TIZEN_SUPPORT_SAT_ICON)
/* Icon data extraction */
- g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE ("a(biiiiiis)"));
- if(setup_call_tlv->call_setup_icon_id.is_exist) {
+ g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE("a(biiiiiis)"));
+ if (setup_call_tlv->call_setup_icon_id.is_exist) {
g_variant_builder_add(&v_builder_icon, "(biiiiiis)", setup_call_tlv->call_setup_icon_id.is_exist, setup_call_tlv->call_setup_icon_id.icon_qualifer, (gint32) setup_call_tlv->call_setup_icon_id.icon_identifier, (gint32) setup_call_tlv->call_setup_icon_id.icon_info.width,
(gint32) setup_call_tlv->call_setup_icon_id.icon_info.height, setup_call_tlv->call_setup_icon_id.icon_info.ics, setup_call_tlv->call_setup_icon_id.icon_info.icon_data_len, setup_call_tlv->call_setup_icon_id.icon_info.icon_file);
}
{
TcorePlugin *plg = NULL;
GVariant *event_list = NULL;
-
- int local_index = 0;
gboolean rv = FALSE;
- gint event_cnt = 0;
- GVariantBuilder builder;
- GVariant *evt_list = NULL;
+ unsigned char event_cnt = 0;
struct treq_sat_terminal_rsp_data *tr = NULL;
dbg("interpreting event list notification");
plg = tcore_server_find_plugin(ctx->server, cp_name);
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return NULL;
}
- //event cnt
+ /* event cnt */
event_cnt = event_list_tlv->event_list.event_list_cnt;
dbg("event cnt(%d)", event_cnt);
- // reset evnet list
+ /* reset evnet list */
memset(g_evt_list, 0, SAT_EVENT_DOWNLOAD_MAX);
- //get event
- g_variant_builder_init(&builder, G_VARIANT_TYPE ("ai"));
- for (local_index = 0; local_index < event_cnt; local_index++) {
- g_variant_builder_add(&builder, "i", event_list_tlv->event_list.evt_list[local_index]);
- if(event_list_tlv->event_list.evt_list[local_index] >= SAT_EVENT_DOWNLOAD_MAX)
- continue;
- g_evt_list[event_list_tlv->event_list.evt_list[local_index]] = TRUE;
- }
- evt_list = g_variant_builder_end(&builder);
-
- event_list = g_variant_new("(iv)", event_cnt, evt_list);
+ rv = sat_manager_check_availiable_event_list(event_list_tlv);
+ dbg("rv of sat_manager_check_availiable_event_list()=[%d]", rv);
+ /* get event */
+ if (rv == TRUE) {
+ int local_index = 0;
+ GVariantBuilder builder;
+ GVariant *evt_list = NULL;
+ /* get event */
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("ai"));
+ for (local_index = 0; local_index < event_cnt; local_index++) {
+ g_variant_builder_add(&builder, "i", event_list_tlv->event_list.evt_list[local_index]);
+ if (event_list_tlv->event_list.evt_list[local_index] >= SAT_EVENT_DOWNLOAD_MAX)
+ continue;
+ g_evt_list[event_list_tlv->event_list.evt_list[local_index]] = TRUE;
+ }
+ evt_list = g_variant_builder_end(&builder);
- //send TR - does not need from application's response
+ event_list = g_variant_new("(yv)", event_cnt, evt_list);
+ }
+ /* send TR - does not need from application's response */
tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
if (!tr)
return NULL;
+
tr->cmd_number = event_list_tlv->command_detail.cmd_num;
tr->cmd_type = event_list_tlv->command_detail.cmd_type;
memcpy((void*)&tr->terminal_rsp_data.setup_event_list.command_detail, &event_list_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
tr->terminal_rsp_data.setup_event_list.device_id.src = event_list_tlv->device_id.dest;
tr->terminal_rsp_data.setup_event_list.device_id.dest = event_list_tlv->device_id.src;
- tr->terminal_rsp_data.setup_event_list.result_type = RESULT_SUCCESS;
- tr->terminal_rsp_data.setup_event_list.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- rv = sat_manager_check_availiable_event_list(event_list_tlv);
- dbg("rv of sat_manager_check_availiable_event_list()=[%d]", rv);
+ if (rv == TRUE)
+ tr->terminal_rsp_data.setup_event_list.result_type = RESULT_SUCCESS;
+ else
+ tr->terminal_rsp_data.setup_event_list.result_type = RESULT_BEYOND_ME_CAPABILITIES;
sat_manager_send_terminal_response(ctx->comm, plg, tr);
g_free(tr);
memset(&text, 0 , SAT_TEXT_STRING_LEN_MAX+1);
plg = tcore_server_find_plugin(ctx->server, cp_name);
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return NULL;
}
- if(!idle_mode_tlv->text.string_length && decode_error != TCORE_SAT_SUCCESS){
+ if (!idle_mode_tlv->text.string_length && decode_error != TCORE_SAT_SUCCESS) {
struct treq_sat_terminal_rsp_data tr;
dbg("setup idle mode text - invalid parameter of TLVs is found!!");
return NULL;
}
- tcore_util_convert_string_to_utf8((unsigned char*)&text,(unsigned short *)&text_len,
- idle_mode_tlv->text.dcs.a_format,
- (unsigned char*)&idle_mode_tlv->text.string,
- (unsigned short)idle_mode_tlv->text.string_length);
+ tcore_util_convert_string_to_utf8((unsigned char*)&text, (unsigned short *)&text_len,
+ idle_mode_tlv->text.dcs.a_format,
+ (unsigned char*)&idle_mode_tlv->text.string,
+ (unsigned short)idle_mode_tlv->text.string_length);
- dbg("setup idle mode text display text (%s)",text);
+ dbg("setup idle mode text display text (%s)", text);
- //enqueue data and generate cmd_id
+ /* enqueue data and generate cmd_id */
memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
q_data.cmd_type = SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT;
q_data.cp_name = g_strdup(cp_name);
memcpy((void*)&(q_data.cmd_data.idle_mode), idle_mode_tlv, sizeof(struct tel_sat_setup_idle_mode_text_tlv));
- if(FALSE == sat_manager_enqueue_cmd(ctx, &q_data)){
+ if (FALSE == sat_manager_enqueue_cmd(ctx, &q_data))
g_free(q_data.cp_name);
- }
command_id = q_data.cmd_id;
#if defined(TIZEN_SUPPORT_SAT_ICON)
/* Icon data extraction */
- g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE ("a(biiiiiis)"));
- if(idle_mode_tlv->icon_id.is_exist) {
+ g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE("a(biiiiiis)"));
+ if (idle_mode_tlv->icon_id.is_exist) {
g_variant_builder_add(&v_builder_icon, "(biiiiiis)", idle_mode_tlv->icon_id.is_exist, idle_mode_tlv->icon_id.icon_qualifer, (gint32) idle_mode_tlv->icon_id.icon_identifier, (gint32) idle_mode_tlv->icon_id.icon_info.width,
(gint32) idle_mode_tlv->icon_id.icon_info.height, idle_mode_tlv->icon_id.icon_info.ics, idle_mode_tlv->icon_id.icon_info.icon_data_len, idle_mode_tlv->icon_id.icon_info.icon_file);
}
memset(&dest_address, 0 , SAT_OTHER_ADDR_LEN_MAX);
plg = tcore_server_find_plugin(ctx->server, cp_name);
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return NULL;
}
co_call = tcore_plugin_ref_core_object(plg, CORE_OBJECT_TYPE_CALL);
co_network = tcore_plugin_ref_core_object(plg, CORE_OBJECT_TYPE_NETWORK);
- if(!co_call || !co_network){
+ if (!co_call || !co_network) {
struct treq_sat_terminal_rsp_data tr;
dbg("call or network co_obj does not exist");
}
call_active_list = tcore_call_object_find_by_status(co_call, TCORE_CALL_STATUS_ACTIVE);
- tcore_network_get_access_technology(co_network,&result);
- if(result < NETWORK_ACT_UMTS && call_active_list){
+ tcore_network_get_access_technology(co_network, &result);
+ if (result < NETWORK_ACT_UMTS && call_active_list) {
struct treq_sat_terminal_rsp_data tr;
dbg("call is busy in not 3G state atc(%d)", result);
}
- //immediate link
+ /* immediate link */
immediate_link = open_channel_tlv->command_detail.cmd_qualifier.open_channel.immediate_link;
- //auto reconnection
+ /* auto reconnection */
auto_reconnection = open_channel_tlv->command_detail.cmd_qualifier.open_channel.automatic_reconnection;
- //back ground mode
+ /* back ground mode */
bg_mode = open_channel_tlv->command_detail.cmd_qualifier.open_channel.background_mode;
- //open channel text
- if(open_channel_tlv->alpha_id.is_exist && open_channel_tlv->alpha_id.alpha_data_len > 0)
- tcore_util_convert_string_to_utf8((unsigned char*)&text,(unsigned short *)&text_len,
+ /* open channel text */
+ if (open_channel_tlv->alpha_id.is_exist && open_channel_tlv->alpha_id.alpha_data_len > 0)
+ tcore_util_convert_string_to_utf8((unsigned char*)&text, (unsigned short *)&text_len,
open_channel_tlv->alpha_id.dcs.a_format,
(unsigned char*)&open_channel_tlv->alpha_id.alpha_data,
(unsigned short)open_channel_tlv->alpha_id.alpha_data_len);
- dbg("open channel text(%s)",text);
+ dbg("open channel text(%s)", text);
- //buffer size
+ /* buffer size */
buffer_size = open_channel_tlv->buffer_size.size[0];
buffer_size = buffer_size << 8;
buffer_size += open_channel_tlv->buffer_size.size[1];
- //memcpy(&buffer_size, open_channel_tlv->buffer_size.size, sizeof(unsigned char)*2);
+ /* memcpy(&buffer_size, open_channel_tlv->buffer_size.size, sizeof(unsigned char)*2); */
dbg("buffer size(%d)", buffer_size);
- //interface transport level
+ /* interface transport level */
protocol_type = open_channel_tlv->interface_transport_level.protocol_type;
port_number = open_channel_tlv->interface_transport_level.port_number;
- //data destination address
+ /* data destination address */
dest_addr_type = open_channel_tlv->data_destination_address.address_type;
memcpy(dest_address, open_channel_tlv->data_destination_address.address,
open_channel_tlv->data_destination_address.address_len);
dbg("destination IP address (%s)", dest_address);
- //bearer type
+ /* bearer type */
bearer_type = open_channel_tlv->bearer_desc.bearer_type;
- //bearer param & bearer detail
- switch(bearer_type){
- case BEARER_CSD:{
- //bearer param
- gint data_rate = 0, service_type = 0, conn_element_type = 0;
-
- //bearer detail
- gint ton = 0, npi = 0, time_duration1 = 0, time_duration2 = 0, other_addr_type = 0;
- gushort login_len = 0, pwd_len = 0;
- gchar dialling_number[SAT_DIALING_NUMBER_LEN_MAX], sub_addr[SAT_SUB_ADDR_LEN_MAX];
- gchar other_address[SAT_OTHER_ADDR_LEN_MAX];
- gchar login[SAT_TEXT_STRING_LEN_MAX], pwd[SAT_TEXT_STRING_LEN_MAX];
-
- memset(&dialling_number, 0 , SAT_DIALING_NUMBER_LEN_MAX);
- memset(&sub_addr, 0 , SAT_SUB_ADDR_LEN_MAX);
- memset(&other_address, 0 , SAT_OTHER_ADDR_LEN_MAX);
- memset(&login, 0 , SAT_TEXT_STRING_LEN_MAX);
- memset(&pwd, 0 , SAT_TEXT_STRING_LEN_MAX);
-
- //bearer parameter
- data_rate = open_channel_tlv->bearer_desc.bearer_parameter.cs_bearer_param.data_rate;
- service_type = open_channel_tlv->bearer_desc.bearer_parameter.cs_bearer_param.service_type;
- conn_element_type = open_channel_tlv->bearer_desc.bearer_parameter.cs_bearer_param.connection_element_type;
-
- bearer_param = g_variant_new("(iii)", data_rate, service_type, conn_element_type);
-
- //bearer detail
- ton = open_channel_tlv->bearer_detail.cs_bearer.address.ton;
- npi = open_channel_tlv->bearer_detail.cs_bearer.address.npi;
- memcpy(dialling_number, open_channel_tlv->bearer_detail.cs_bearer.address.dialing_number, open_channel_tlv->bearer_detail.cs_bearer.address.dialing_number_len);
-
- memcpy(sub_addr, open_channel_tlv->bearer_detail.cs_bearer.subaddress.subaddress, open_channel_tlv->bearer_detail.cs_bearer.subaddress.subaddress_len);
-
- time_duration1 = _get_time_in_ms(&open_channel_tlv->bearer_detail.cs_bearer.duration1);
- time_duration2 = _get_time_in_ms(&open_channel_tlv->bearer_detail.cs_bearer.duration2);
-
- other_addr_type = open_channel_tlv->bearer_detail.cs_bearer.other_address.address_type;
- memcpy(other_address, open_channel_tlv->bearer_detail.cs_bearer.other_address.address, open_channel_tlv->bearer_detail.cs_bearer.other_address.address_len);
-
- tcore_util_convert_string_to_utf8((unsigned char*) &login, (unsigned short *) &login_len,
- open_channel_tlv->bearer_detail.cs_bearer.text_user_login.dcs.a_format,
- (unsigned char*) &open_channel_tlv->bearer_detail.cs_bearer.text_user_login.string,
- (unsigned short) open_channel_tlv->bearer_detail.cs_bearer.text_user_login.string_length);
-
- tcore_util_convert_string_to_utf8((unsigned char*) &pwd, (unsigned short *) &pwd_len,
- open_channel_tlv->bearer_detail.cs_bearer.text_user_pwd.dcs.a_format,
- (unsigned char*) &open_channel_tlv->bearer_detail.cs_bearer.text_user_pwd.string,
- (unsigned short) open_channel_tlv->bearer_detail.cs_bearer.text_user_pwd.string_length);
-
- bearer_detail= g_variant_new("(iissiiisss)", ton, npi, dialling_number, sub_addr, time_duration1, time_duration2,
- other_addr_type, other_address, login, pwd);
- } break;
- case BEARER_GPRS:{
- //bearer param
- gint precedence_class = 0, delay_class = 0, reliability_class = 0;
- gint peak_class = 0, mean_class = 0, pdp_type = 0;
-
- //bearer detail
- gint other_addr_type = 0;
- gushort login_len = 0, pwd_len = 0;
- gchar network_access_name[SAT_NET_ACC_NAM_LEN_MAX];
- gchar other_address[SAT_OTHER_ADDR_LEN_MAX];
- gchar login[SAT_TEXT_STRING_LEN_MAX], pwd[SAT_TEXT_STRING_LEN_MAX];
-
- memset(&network_access_name, 0 , SAT_NET_ACC_NAM_LEN_MAX);
- memset(&other_address, 0 , SAT_OTHER_ADDR_LEN_MAX);
- memset(&login, 0 , SAT_TEXT_STRING_LEN_MAX);
- memset(&pwd, 0 , SAT_TEXT_STRING_LEN_MAX);
-
- //bearer parameter
- precedence_class = open_channel_tlv->bearer_desc.bearer_parameter.ps_bearer_param.precedence_class;
- delay_class = open_channel_tlv->bearer_desc.bearer_parameter.ps_bearer_param.delay_class;
- reliability_class = open_channel_tlv->bearer_desc.bearer_parameter.ps_bearer_param.reliability_class;
- peak_class = open_channel_tlv->bearer_desc.bearer_parameter.ps_bearer_param.peak_throughput_class;
- mean_class = open_channel_tlv->bearer_desc.bearer_parameter.ps_bearer_param.mean_throughput_class;
- pdp_type = open_channel_tlv->bearer_desc.bearer_parameter.ps_bearer_param.pdp_type;
-
- bearer_param = g_variant_new("(iiiiii)", precedence_class, delay_class, reliability_class, peak_class, mean_class, pdp_type);
-
- memcpy(network_access_name, open_channel_tlv->bearer_detail.ps_bearer.network_access_name.network_access_name,
- open_channel_tlv->bearer_detail.ps_bearer.network_access_name.length);
- other_addr_type = open_channel_tlv->bearer_detail.ps_bearer.other_address.address_type;
- memcpy(other_address, open_channel_tlv->bearer_detail.ps_bearer.other_address.address, open_channel_tlv->bearer_detail.ps_bearer.other_address.address_len);
-
- tcore_util_convert_string_to_utf8((unsigned char*) &login, (unsigned short *) &login_len,
- open_channel_tlv->bearer_detail.ps_bearer.text_user_login.dcs.a_format,
- (unsigned char*) &open_channel_tlv->bearer_detail.ps_bearer.text_user_login.string,
- (unsigned short) open_channel_tlv->bearer_detail.ps_bearer.text_user_login.string_length);
-
- tcore_util_convert_string_to_utf8((unsigned char*) &pwd, (unsigned short *) &pwd_len,
- open_channel_tlv->bearer_detail.ps_bearer.text_user_pwd.dcs.a_format,
- (unsigned char*) &open_channel_tlv->bearer_detail.ps_bearer.text_user_pwd.string,
- (unsigned short) open_channel_tlv->bearer_detail.ps_bearer.text_user_pwd.string_length);
-
- bearer_detail= g_variant_new("(sisss)", network_access_name, other_addr_type, other_address, login, pwd);
-
- } break;
- case BEARER_DEFAULT_BEARER_FROM_TRANSPORT_LAYER:{
- //bearer param
-
- //bearer detail
- gint other_addr_type = 0;
- gushort login_len = 0, pwd_len = 0;
- gchar other_address[SAT_OTHER_ADDR_LEN_MAX];
- gchar login[SAT_TEXT_STRING_LEN_MAX], pwd[SAT_TEXT_STRING_LEN_MAX];
-
- memset(&other_address, 0 , SAT_OTHER_ADDR_LEN_MAX);
- memset(&login, 0 , SAT_TEXT_STRING_LEN_MAX);
- memset(&pwd, 0 , SAT_TEXT_STRING_LEN_MAX);
-
- //bearer parameter
- bearer_param = g_variant_new("()");
-
- other_addr_type = open_channel_tlv->bearer_detail.default_bearer.other_address.address_type;
- memcpy(other_address, open_channel_tlv->bearer_detail.default_bearer.other_address.address, open_channel_tlv->bearer_detail.default_bearer.other_address.address_len);
-
- tcore_util_convert_string_to_utf8((unsigned char*) &login, (unsigned short *) &login_len,
- open_channel_tlv->bearer_detail.default_bearer.text_user_login.dcs.a_format,
- (unsigned char*) &open_channel_tlv->bearer_detail.default_bearer.text_user_login.string,
- (unsigned short) open_channel_tlv->bearer_detail.default_bearer.text_user_login.string_length);
-
- tcore_util_convert_string_to_utf8((unsigned char*) &pwd, (unsigned short *) &pwd_len,
- open_channel_tlv->bearer_detail.default_bearer.text_user_pwd.dcs.a_format,
- (unsigned char*) &open_channel_tlv->bearer_detail.default_bearer.text_user_pwd.string,
- (unsigned short) open_channel_tlv->bearer_detail.default_bearer.text_user_pwd.string_length);
-
- bearer_detail= g_variant_new("(isss)", other_addr_type, other_address, login, pwd);
-
- } break;
- case BEARER_LOCAL_LINK_TECHNOLOGY_INDEPENDENT:{
- //bearer param
-
- //bearer detail
- gushort pwd_len = 0;
- gint remote_address_type =0, time_duration1 = 0, time_duration2 = 0;
- gchar remote_address[SAT_REMOTE_ENTITY_ADDR_LEN_MAX];
- gchar pwd[SAT_TEXT_STRING_LEN_MAX];
-
- memset(&remote_address, 0 , SAT_REMOTE_ENTITY_ADDR_LEN_MAX);
- memset(&pwd, 0 , SAT_TEXT_STRING_LEN_MAX);
-
- //bearer parameter
- bearer_param = g_variant_new("()");
-
- time_duration1 = _get_time_in_ms(&open_channel_tlv->bearer_detail.local_bearer.duration1);
- time_duration2 = _get_time_in_ms(&open_channel_tlv->bearer_detail.local_bearer.duration2);
-
- tcore_util_convert_string_to_utf8((unsigned char*) &pwd, (unsigned short *) &pwd_len,
- open_channel_tlv->bearer_detail.default_bearer.text_user_pwd.dcs.a_format,
- (unsigned char*) &open_channel_tlv->bearer_detail.default_bearer.text_user_pwd.string,
- (unsigned short) open_channel_tlv->bearer_detail.default_bearer.text_user_pwd.string_length);
-
- remote_address_type = open_channel_tlv->bearer_detail.local_bearer.remote_entity_address.coding_type;
- memcpy(remote_address, open_channel_tlv->bearer_detail.local_bearer.remote_entity_address.remote_entity_address, open_channel_tlv->bearer_detail.local_bearer.remote_entity_address.length);
-
- bearer_detail= g_variant_new("(iisis)", time_duration1, time_duration2, pwd, remote_address_type, remote_address);
-
+ /* bearer param & bearer detail */
+ switch (bearer_type) {
+ case BEARER_CSD: {
+ /* bearer param */
+ gint data_rate = 0, service_type = 0, conn_element_type = 0;
+
+ /* bearer detail */
+ gint ton = 0, npi = 0, time_duration1 = 0, time_duration2 = 0, other_addr_type = 0;
+ gushort login_len = 0, pwd_len = 0;
+ gchar dialling_number[SAT_DIALING_NUMBER_LEN_MAX], sub_addr[SAT_SUB_ADDR_LEN_MAX];
+ gchar other_address[SAT_OTHER_ADDR_LEN_MAX];
+ gchar login[SAT_TEXT_STRING_LEN_MAX], pwd[SAT_TEXT_STRING_LEN_MAX];
+
+ memset(&dialling_number, 0 , SAT_DIALING_NUMBER_LEN_MAX);
+ memset(&sub_addr, 0 , SAT_SUB_ADDR_LEN_MAX);
+ memset(&other_address, 0 , SAT_OTHER_ADDR_LEN_MAX);
+ memset(&login, 0 , SAT_TEXT_STRING_LEN_MAX);
+ memset(&pwd, 0 , SAT_TEXT_STRING_LEN_MAX);
+
+ /* bearer parameter */
+ data_rate = open_channel_tlv->bearer_desc.bearer_parameter.cs_bearer_param.data_rate;
+ service_type = open_channel_tlv->bearer_desc.bearer_parameter.cs_bearer_param.service_type;
+ conn_element_type = open_channel_tlv->bearer_desc.bearer_parameter.cs_bearer_param.connection_element_type;
+
+ bearer_param = g_variant_new("(iii)", data_rate, service_type, conn_element_type);
+
+ /* bearer detail */
+ ton = open_channel_tlv->bearer_detail.cs_bearer.address.ton;
+ npi = open_channel_tlv->bearer_detail.cs_bearer.address.npi;
+ memcpy(dialling_number, open_channel_tlv->bearer_detail.cs_bearer.address.dialing_number, open_channel_tlv->bearer_detail.cs_bearer.address.dialing_number_len);
+
+ memcpy(sub_addr, open_channel_tlv->bearer_detail.cs_bearer.subaddress.subaddress, open_channel_tlv->bearer_detail.cs_bearer.subaddress.subaddress_len);
+
+ time_duration1 = _get_time_in_ms(&open_channel_tlv->bearer_detail.cs_bearer.duration1);
+ time_duration2 = _get_time_in_ms(&open_channel_tlv->bearer_detail.cs_bearer.duration2);
+
+ other_addr_type = open_channel_tlv->bearer_detail.cs_bearer.other_address.address_type;
+ memcpy(other_address, open_channel_tlv->bearer_detail.cs_bearer.other_address.address, open_channel_tlv->bearer_detail.cs_bearer.other_address.address_len);
+
+ tcore_util_convert_string_to_utf8((unsigned char*) &login, (unsigned short *) &login_len,
+ open_channel_tlv->bearer_detail.cs_bearer.text_user_login.dcs.a_format,
+ (unsigned char*) &open_channel_tlv->bearer_detail.cs_bearer.text_user_login.string,
+ (unsigned short) open_channel_tlv->bearer_detail.cs_bearer.text_user_login.string_length);
+
+ tcore_util_convert_string_to_utf8((unsigned char*) &pwd, (unsigned short *) &pwd_len,
+ open_channel_tlv->bearer_detail.cs_bearer.text_user_pwd.dcs.a_format,
+ (unsigned char*) &open_channel_tlv->bearer_detail.cs_bearer.text_user_pwd.string,
+ (unsigned short) open_channel_tlv->bearer_detail.cs_bearer.text_user_pwd.string_length);
+
+ bearer_detail = g_variant_new("(iissiiisss)", ton, npi, dialling_number, sub_addr, time_duration1, time_duration2,
+ other_addr_type, other_address, login, pwd);
} break;
- default:
- dbg("invalid bearer data");
- return NULL;
- }//end of switch
+ case BEARER_GPRS:{
+ /* bearer param */
+ gint precedence_class = 0, delay_class = 0, reliability_class = 0;
+ gint peak_class = 0, mean_class = 0, pdp_type = 0;
+
+ /* bearer detail */
+ gint other_addr_type = 0;
+ gushort login_len = 0, pwd_len = 0;
+ gchar network_access_name[SAT_NET_ACC_NAM_LEN_MAX];
+ gchar other_address[SAT_OTHER_ADDR_LEN_MAX];
+ gchar login[SAT_TEXT_STRING_LEN_MAX], pwd[SAT_TEXT_STRING_LEN_MAX];
+
+ memset(&network_access_name, 0 , SAT_NET_ACC_NAM_LEN_MAX);
+ memset(&other_address, 0 , SAT_OTHER_ADDR_LEN_MAX);
+ memset(&login, 0 , SAT_TEXT_STRING_LEN_MAX);
+ memset(&pwd, 0 , SAT_TEXT_STRING_LEN_MAX);
+
+ /* bearer parameter */
+ precedence_class = open_channel_tlv->bearer_desc.bearer_parameter.ps_bearer_param.precedence_class;
+ delay_class = open_channel_tlv->bearer_desc.bearer_parameter.ps_bearer_param.delay_class;
+ reliability_class = open_channel_tlv->bearer_desc.bearer_parameter.ps_bearer_param.reliability_class;
+ peak_class = open_channel_tlv->bearer_desc.bearer_parameter.ps_bearer_param.peak_throughput_class;
+ mean_class = open_channel_tlv->bearer_desc.bearer_parameter.ps_bearer_param.mean_throughput_class;
+ pdp_type = open_channel_tlv->bearer_desc.bearer_parameter.ps_bearer_param.pdp_type;
+
+ bearer_param = g_variant_new("(iiiiii)", precedence_class, delay_class, reliability_class, peak_class, mean_class, pdp_type);
+
+ memcpy(network_access_name, open_channel_tlv->bearer_detail.ps_bearer.network_access_name.network_access_name,
+ open_channel_tlv->bearer_detail.ps_bearer.network_access_name.length);
+ other_addr_type = open_channel_tlv->bearer_detail.ps_bearer.other_address.address_type;
+ memcpy(other_address, open_channel_tlv->bearer_detail.ps_bearer.other_address.address, open_channel_tlv->bearer_detail.ps_bearer.other_address.address_len);
+
+ tcore_util_convert_string_to_utf8((unsigned char*) &login, (unsigned short *) &login_len,
+ open_channel_tlv->bearer_detail.ps_bearer.text_user_login.dcs.a_format,
+ (unsigned char*) &open_channel_tlv->bearer_detail.ps_bearer.text_user_login.string,
+ (unsigned short) open_channel_tlv->bearer_detail.ps_bearer.text_user_login.string_length);
+
+ tcore_util_convert_string_to_utf8((unsigned char*) &pwd, (unsigned short *) &pwd_len,
+ open_channel_tlv->bearer_detail.ps_bearer.text_user_pwd.dcs.a_format,
+ (unsigned char*) &open_channel_tlv->bearer_detail.ps_bearer.text_user_pwd.string,
+ (unsigned short) open_channel_tlv->bearer_detail.ps_bearer.text_user_pwd.string_length);
+
+ bearer_detail = g_variant_new("(sisss)", network_access_name, other_addr_type, other_address, login, pwd);
+ } break;
+ case BEARER_DEFAULT_BEARER_FROM_TRANSPORT_LAYER:{
+ /* bearer param */
+
+ /* bearer detail */
+ gint other_addr_type = 0;
+ gushort login_len = 0, pwd_len = 0;
+ gchar other_address[SAT_OTHER_ADDR_LEN_MAX];
+ gchar login[SAT_TEXT_STRING_LEN_MAX], pwd[SAT_TEXT_STRING_LEN_MAX];
+
+ memset(&other_address, 0 , SAT_OTHER_ADDR_LEN_MAX);
+ memset(&login, 0 , SAT_TEXT_STRING_LEN_MAX);
+ memset(&pwd, 0 , SAT_TEXT_STRING_LEN_MAX);
+
+ /* bearer parameter */
+ bearer_param = g_variant_new("()");
+
+ other_addr_type = open_channel_tlv->bearer_detail.default_bearer.other_address.address_type;
+ memcpy(other_address, open_channel_tlv->bearer_detail.default_bearer.other_address.address, open_channel_tlv->bearer_detail.default_bearer.other_address.address_len);
+
+ tcore_util_convert_string_to_utf8((unsigned char*) &login, (unsigned short *) &login_len,
+ open_channel_tlv->bearer_detail.default_bearer.text_user_login.dcs.a_format,
+ (unsigned char*) &open_channel_tlv->bearer_detail.default_bearer.text_user_login.string,
+ (unsigned short) open_channel_tlv->bearer_detail.default_bearer.text_user_login.string_length);
+
+ tcore_util_convert_string_to_utf8((unsigned char*) &pwd, (unsigned short *) &pwd_len,
+ open_channel_tlv->bearer_detail.default_bearer.text_user_pwd.dcs.a_format,
+ (unsigned char*) &open_channel_tlv->bearer_detail.default_bearer.text_user_pwd.string,
+ (unsigned short) open_channel_tlv->bearer_detail.default_bearer.text_user_pwd.string_length);
+
+ bearer_detail = g_variant_new("(isss)", other_addr_type, other_address, login, pwd);
+ } break;
+ case BEARER_LOCAL_LINK_TECHNOLOGY_INDEPENDENT:{
+ /* bearer param */
+
+ /* bearer detail */
+ gushort pwd_len = 0;
+ gint remote_address_type = 0, time_duration1 = 0, time_duration2 = 0;
+ gchar remote_address[SAT_REMOTE_ENTITY_ADDR_LEN_MAX];
+ gchar pwd[SAT_TEXT_STRING_LEN_MAX];
+
+ memset(&remote_address, 0 , SAT_REMOTE_ENTITY_ADDR_LEN_MAX);
+ memset(&pwd, 0 , SAT_TEXT_STRING_LEN_MAX);
+
+ /* bearer parameter */
+ bearer_param = g_variant_new("()");
+
+ time_duration1 = _get_time_in_ms(&open_channel_tlv->bearer_detail.local_bearer.duration1);
+ time_duration2 = _get_time_in_ms(&open_channel_tlv->bearer_detail.local_bearer.duration2);
+
+ tcore_util_convert_string_to_utf8((unsigned char*) &pwd, (unsigned short *) &pwd_len,
+ open_channel_tlv->bearer_detail.default_bearer.text_user_pwd.dcs.a_format,
+ (unsigned char*) &open_channel_tlv->bearer_detail.default_bearer.text_user_pwd.string,
+ (unsigned short) open_channel_tlv->bearer_detail.default_bearer.text_user_pwd.string_length);
+
+ remote_address_type = open_channel_tlv->bearer_detail.local_bearer.remote_entity_address.coding_type;
+ memcpy(remote_address, open_channel_tlv->bearer_detail.local_bearer.remote_entity_address.remote_entity_address, open_channel_tlv->bearer_detail.local_bearer.remote_entity_address.length);
+
+ bearer_detail = g_variant_new("(iisis)", time_duration1, time_duration2, pwd, remote_address_type, remote_address);
+ } break;
+ default:
+ dbg("invalid bearer data");
+ return NULL;
+ }
- //enqueue data and generate cmd_id
+ /* enqueue data and generate cmd_id */
memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
q_data.cmd_type = SAT_PROATV_CMD_OPEN_CHANNEL;
q_data.cp_name = g_strdup(cp_name);
memcpy((void*)&(q_data.cmd_data.open_channel), open_channel_tlv, sizeof(struct tel_sat_open_channel_tlv));
- if(FALSE == sat_manager_enqueue_cmd(ctx, &q_data)){
+ if (FALSE == sat_manager_enqueue_cmd(ctx, &q_data))
g_free(q_data.cp_name);
- }
command_id = q_data.cmd_id;
#if defined(TIZEN_SUPPORT_STK_HIDE_ALPHA_ID)
#if defined(TIZEN_SUPPORT_SAT_ICON)
/* Icon data extraction */
- g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE ("a(biiiiiis)"));
- if(open_channel_tlv->icon_id.is_exist) {
+ g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE("a(biiiiiis)"));
+ if (open_channel_tlv->icon_id.is_exist) {
g_variant_builder_add(&v_builder_icon, "(biiiiiis)", open_channel_tlv->icon_id.is_exist, open_channel_tlv->icon_id.icon_qualifer, (gint32) open_channel_tlv->icon_id.icon_identifier, (gint32) open_channel_tlv->icon_id.icon_info.width,
(gint32) open_channel_tlv->icon_id.icon_info.height, open_channel_tlv->icon_id.icon_info.ics, open_channel_tlv->icon_id.icon_info.icon_data_len, open_channel_tlv->icon_id.icon_info.icon_file);
}
icon_id = g_variant_builder_end(&v_builder_icon);
- //execute bip
- //sat_ui_support_exec_bip();
+ /* execute bip */
+ /* sat_ui_support_exec_bip(); */
open_channel = g_variant_new("(isivbbbiviiiisv)", command_id, text, text_len, icon_id, immediate_link, auto_reconnection, bg_mode,
bearer_type, bearer_param, buffer_size, protocol_type, port_number, dest_addr_type, dest_address, bearer_detail);
memset(&text, 0 , SAT_ALPHA_ID_LEN_MAX);
plg = tcore_server_find_plugin(ctx->server, cp_name);
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return NULL;
}
- //channel id
+ /* channel id */
channel_id = close_channel_tlv->device_id.dest;
- //close channel text
- if(close_channel_tlv->alpha_id.is_exist && close_channel_tlv->alpha_id.alpha_data_len > 0)
- tcore_util_convert_string_to_utf8((unsigned char*)&text,(unsigned short *)&text_len,
+ /* close channel text */
+ if (close_channel_tlv->alpha_id.is_exist && close_channel_tlv->alpha_id.alpha_data_len > 0)
+ tcore_util_convert_string_to_utf8((unsigned char*)&text, (unsigned short *)&text_len,
close_channel_tlv->alpha_id.dcs.a_format,
(unsigned char*)&close_channel_tlv->alpha_id.alpha_data,
(unsigned short)close_channel_tlv->alpha_id.alpha_data_len);
- dbg("close channel text(%s)",text);
+ dbg("close channel text(%s)", text);
- //enqueue data and generate cmd_id
+ /* enqueue data and generate cmd_id */
memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
q_data.cmd_type = SAT_PROATV_CMD_CLOSE_CHANNEL;
q_data.cp_name = g_strdup(cp_name);
memcpy((void*)&(q_data.cmd_data.close_channel), close_channel_tlv, sizeof(struct tel_sat_close_channel_tlv));
- if(FALSE == sat_manager_enqueue_cmd(ctx, &q_data)){
+ if (FALSE == sat_manager_enqueue_cmd(ctx, &q_data))
g_free(q_data.cp_name);
- }
command_id = q_data.cmd_id;
#if defined(TIZEN_SUPPORT_SAT_ICON)
/* Icon data extraction */
- g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE ("a(biiiiiis)"));
- if(close_channel_tlv->icon_id.is_exist) {
+ g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE("a(biiiiiis)"));
+ if (close_channel_tlv->icon_id.is_exist) {
g_variant_builder_add(&v_builder_icon, "(biiiiiis)", close_channel_tlv->icon_id.is_exist, close_channel_tlv->icon_id.icon_qualifer, (gint32) close_channel_tlv->icon_id.icon_identifier, (gint32) close_channel_tlv->icon_id.icon_info.width,
(gint32) close_channel_tlv->icon_id.icon_info.height, close_channel_tlv->icon_id.icon_info.ics, close_channel_tlv->icon_id.icon_info.icon_data_len, close_channel_tlv->icon_id.icon_info.icon_file);
}
memset(&text, 0 , SAT_ALPHA_ID_LEN_MAX);
plg = tcore_server_find_plugin(ctx->server, cp_name);
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return NULL;
}
- //channel id
+ /* channel id */
channel_id = receive_data_tlv->device_id.dest;
- //receive data text
- if(receive_data_tlv->alpha_id.is_exist && receive_data_tlv->alpha_id.alpha_data_len > 0)
- tcore_util_convert_string_to_utf8((unsigned char*)&text,(unsigned short *)&text_len,
+ /* receive data text */
+ if (receive_data_tlv->alpha_id.is_exist && receive_data_tlv->alpha_id.alpha_data_len > 0)
+ tcore_util_convert_string_to_utf8((unsigned char*)&text, (unsigned short *)&text_len,
receive_data_tlv->alpha_id.dcs.a_format,
(unsigned char*)&receive_data_tlv->alpha_id.alpha_data,
(unsigned short)receive_data_tlv->alpha_id.alpha_data_len);
- dbg("receive data text(%s)",text);
+ dbg("receive data text(%s)", text);
channel_data_len = receive_data_tlv->channel_data_len.data_len;
- //enqueue data and generate cmd_id
+ /* enqueue data and generate cmd_id */
memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
q_data.cmd_type = SAT_PROATV_CMD_RECEIVE_DATA;
q_data.cp_name = g_strdup(cp_name);
memcpy((void*)&(q_data.cmd_data.receive_data), receive_data_tlv, sizeof(struct tel_sat_receive_channel_tlv));
- if(FALSE == sat_manager_enqueue_cmd(ctx, &q_data)){
+ if (FALSE == sat_manager_enqueue_cmd(ctx, &q_data))
g_free(q_data.cp_name);
- }
command_id = q_data.cmd_id;
#if defined(TIZEN_SUPPORT_SAT_ICON)
/* Icon data extraction */
- g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE ("a(biiiiiis)"));
- if(receive_data_tlv->icon_id.is_exist) {
+ g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE("a(biiiiiis)"));
+ if (receive_data_tlv->icon_id.is_exist) {
g_variant_builder_add(&v_builder_icon, "(biiiiiis)", receive_data_tlv->icon_id.is_exist, receive_data_tlv->icon_id.icon_qualifer, (gint32) receive_data_tlv->icon_id.icon_identifier, (gint32) receive_data_tlv->icon_id.icon_info.width,
(gint32) receive_data_tlv->icon_id.icon_info.height, receive_data_tlv->icon_id.icon_info.ics, receive_data_tlv->icon_id.icon_info.icon_data_len, receive_data_tlv->icon_id.icon_info.icon_file);
}
memset(&text, 0 , SAT_ALPHA_ID_LEN_MAX);
plg = tcore_server_find_plugin(ctx->server, cp_name);
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return NULL;
}
- //send data immediately
+ /* send data immediately */
send_data_immediately = send_data_tlv->command_detail.cmd_qualifier.send_data.send_data_immediately;
- //channel id
+ /* channel id */
channel_id = send_data_tlv->device_id.dest;
- //send data text
- if(send_data_tlv->alpha_id.is_exist && send_data_tlv->alpha_id.alpha_data_len > 0)
- tcore_util_convert_string_to_utf8((unsigned char*)&text,(unsigned short *)&text_len,
+ /* send data text */
+ if (send_data_tlv->alpha_id.is_exist && send_data_tlv->alpha_id.alpha_data_len > 0)
+ tcore_util_convert_string_to_utf8((unsigned char*)&text, (unsigned short *)&text_len,
send_data_tlv->alpha_id.dcs.a_format,
(unsigned char*)&send_data_tlv->alpha_id.alpha_data,
(unsigned short)send_data_tlv->alpha_id.alpha_data_len);
- dbg("send data text(%s)",text);
+ dbg("send data text(%s)", text);
- //channel data, data len
+ /* channel data, data len */
data_len = send_data_tlv->channel_data.data_string_len;
- g_variant_builder_init(&builder, G_VARIANT_TYPE ("ay"));
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("ay"));
for (local_index = 0; local_index < data_len; local_index++) {
- //dbg("send data index(%d) data(0x%x)",index, send_data_tlv->channel_data.data_string[index]);
+ /* dbg("send data index(%d) data(0x%x)",index, send_data_tlv->channel_data.data_string[index]); */
g_variant_builder_add(&builder, "y", send_data_tlv->channel_data.data_string[local_index]);
}
channel_data = g_variant_builder_end(&builder);
- //enqueue data and generate cmd_id
+ /* enqueue data and generate cmd_id */
memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
q_data.cmd_type = SAT_PROATV_CMD_SEND_DATA;
q_data.cp_name = g_strdup(cp_name);
memcpy((void*)&(q_data.cmd_data.send_data), send_data_tlv, sizeof(struct tel_sat_send_channel_tlv));
- if(FALSE == sat_manager_enqueue_cmd(ctx, &q_data)){
+ if (FALSE == sat_manager_enqueue_cmd(ctx, &q_data))
g_free(q_data.cp_name);
- }
command_id = q_data.cmd_id;
#if defined(TIZEN_SUPPORT_SAT_ICON)
/* Icon data extraction */
- g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE ("a(biiiiiis)"));
- if(send_data_tlv->icon_id.is_exist) {
+ g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE("a(biiiiiis)"));
+ if (send_data_tlv->icon_id.is_exist) {
g_variant_builder_add(&v_builder_icon, "(biiiiiis)", send_data_tlv->icon_id.is_exist, send_data_tlv->icon_id.icon_qualifer, (gint32) send_data_tlv->icon_id.icon_identifier, (gint32) send_data_tlv->icon_id.icon_info.width,
(gint32) send_data_tlv->icon_id.icon_info.height, send_data_tlv->icon_id.icon_info.ics, send_data_tlv->icon_id.icon_info.icon_data_len, send_data_tlv->icon_id.icon_info.icon_file);
}
dbg("interpreting get channel status notification");
plg = tcore_server_find_plugin(ctx->server, cp_name);
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return NULL;
}
- //enqueue data and generate cmd_id
+ /* enqueue data and generate cmd_id */
memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
q_data.cmd_type = SAT_PROATV_CMD_GET_CHANNEL_STATUS;
q_data.cp_name = g_strdup(cp_name);
memcpy((void*)&(q_data.cmd_data.get_channel_status), get_channel_status_tlv, sizeof(struct tel_sat_get_channel_status_tlv));
- if(FALSE == sat_manager_enqueue_cmd(ctx, &q_data)){
+ if (FALSE == sat_manager_enqueue_cmd(ctx, &q_data))
g_free(q_data.cp_name);
- }
command_id = q_data.cmd_id;
get_channel_status = g_variant_new("(i)", command_id);
#endif
gint command_id = 0;
- gint refresh_type =0;
+ gint refresh_type = 0;
GVariantBuilder builder;
GVariant *file_list = NULL;
int local_index = 0;
dbg("interpreting refresh notification");
plg = tcore_server_find_plugin(ctx->server, cp_name);
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return NULL;
}
refresh_type = refresh_tlv->command_detail.cmd_qualifier.refresh.refresh;
- if(refresh_type != SIM_REFRESH_CMD_FCN) {
+ if (refresh_type != SIM_REFRESH_CMD_FCN) {
dbg("reset event list.");
memset(g_evt_list, 0, SAT_EVENT_DOWNLOAD_MAX);
}
- g_variant_builder_init(&builder, G_VARIANT_TYPE ("ai"));
- for (local_index = 0; local_index < refresh_tlv->file_list.file_count; local_index++) {
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("ai"));
+ for (local_index = 0; local_index < refresh_tlv->file_list.file_count; local_index++)
g_variant_builder_add(&builder, "i", refresh_tlv->file_list.file_id[local_index]);
- }
file_list = g_variant_builder_end(&builder);
- //enqueue data and generate cmd_id
+ /* enqueue data and generate cmd_id */
#if !defined(TIZEN_SUPPORT_STK_HIDE_ALPHA_ID)
memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
q_data.cmd_type = SAT_PROATV_CMD_REFRESH;
q_data.cp_name = g_strdup(cp_name);
memcpy((void*)&(q_data.cmd_data.refresh), refresh_tlv, sizeof(struct tel_sat_refresh_tlv));
- if(FALSE == sat_manager_enqueue_cmd(ctx, &q_data)){
+ if (FALSE == sat_manager_enqueue_cmd(ctx, &q_data))
g_free(q_data.cp_name);
- }
command_id = q_data.cmd_id;
#endif
dbg("interpreting more time notification");
plg = tcore_server_find_plugin(ctx->server, cp_name);
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return;
}
- //send TR - does not need from application's response
+ /* send TR - does not need from application's response */
tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
if (!tr)
return;
struct sat_manager_queue_data q_data;
gint command_id = 0;
- gushort text_len =0;
- gint dtmf_str_len =0;
+ gushort text_len = 0;
+ gint dtmf_str_len = 0;
gchar text[SAT_TEXT_STRING_LEN_MAX], dtmf_str[SAT_DTMF_STRING_LEN_MAX];
#if defined(TIZEN_SUPPORT_SAT_ICON)
GVariant *icon_id = NULL;
memset(&dtmf_str, 0 , SAT_DTMF_STRING_LEN_MAX);
plg = tcore_server_find_plugin(ctx->server, cp_name);
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return NULL;
}
co_call = tcore_plugin_ref_core_object(plg, CORE_OBJECT_TYPE_CALL);
- if(!co_call){
+ if (!co_call) {
struct treq_sat_terminal_rsp_data tr;
dbg("call object does not exist");
}
call_active_list = tcore_call_object_find_by_status(co_call, TCORE_CALL_STATUS_ACTIVE);
- if(!call_active_list){
+ if (!call_active_list) {
struct treq_sat_terminal_rsp_data tr;
dbg("no active call");
}
g_slist_free(call_active_list);
- //text and text len
- if( send_dtmf_tlv->alpha_id.is_exist && send_dtmf_tlv->alpha_id.alpha_data_len){
- tcore_util_convert_string_to_utf8((unsigned char*)&text,(unsigned short *)&text_len,
+ /* text and text len */
+ if (send_dtmf_tlv->alpha_id.is_exist && send_dtmf_tlv->alpha_id.alpha_data_len) {
+ tcore_util_convert_string_to_utf8((unsigned char*)&text, (unsigned short *)&text_len,
send_dtmf_tlv->alpha_id.dcs.a_format,
(unsigned char*)&send_dtmf_tlv->alpha_id.alpha_data,
(unsigned short)send_dtmf_tlv->alpha_id.alpha_data_len);
- dbg("send dtmf ui display text (%s)",text);
+ dbg("send dtmf ui display text (%s)", text);
}
- //dtmf string len, dtmf string
+ /* dtmf string len, dtmf string */
dtmf_str_len = send_dtmf_tlv->dtmf_string.dtmf_length;
memcpy(dtmf_str, send_dtmf_tlv->dtmf_string.dtmf_string, SAT_DTMF_STRING_LEN_MAX);
- //enqueue data and generate cmd_id
+ /* enqueue data and generate cmd_id */
memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
q_data.cmd_type = SAT_PROATV_CMD_SEND_DTMF;
q_data.cp_name = g_strdup(cp_name);
memcpy((void*)&(q_data.cmd_data.send_dtmf), send_dtmf_tlv, sizeof(struct tel_sat_send_dtmf_tlv));
- if(FALSE == sat_manager_enqueue_cmd(ctx, &q_data)){
+ if (FALSE == sat_manager_enqueue_cmd(ctx, &q_data))
g_free(q_data.cp_name);
- }
command_id = q_data.cmd_id;
#if defined(TIZEN_SUPPORT_SAT_ICON)
/* Icon data extraction */
- g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE ("a(biiiiiis)"));
- if(send_dtmf_tlv->icon_id.is_exist) {
+ g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE("a(biiiiiis)"));
+ if (send_dtmf_tlv->icon_id.is_exist) {
g_variant_builder_add(&v_builder_icon, "(biiiiiis)", send_dtmf_tlv->icon_id.is_exist, send_dtmf_tlv->icon_id.icon_qualifer, (gint32) send_dtmf_tlv->icon_id.icon_identifier, (gint32) send_dtmf_tlv->icon_id.icon_info.width,
(gint32) send_dtmf_tlv->icon_id.icon_info.height, send_dtmf_tlv->icon_id.icon_info.ics, send_dtmf_tlv->icon_id.icon_info.icon_data_len, send_dtmf_tlv->icon_id.icon_info.icon_file);
}
#endif
gint command_id = 0;
gint browser_launch_type = 0, browser_id = 0;
- gint url_len =0;
- gushort text_len =0, gateway_proxy_len =0;
+ gint url_len = 0;
+ gushort text_len = 0, gateway_proxy_len = 0;
gchar url[SAT_URL_LEN_MAX], text[SAT_TEXT_STRING_LEN_MAX], gateway_proxy[SAT_TEXT_STRING_LEN_MAX];
#if defined(TIZEN_SUPPORT_SAT_ICON)
GVariant *icon_id = NULL;
memset(&gateway_proxy, 0 , SAT_TEXT_STRING_LEN_MAX);
plg = tcore_server_find_plugin(ctx->server, cp_name);
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return NULL;
}
- if(!launch_browser_tlv->user_confirm_alpha_id.is_exist &&
- (launch_browser_tlv->user_confirm_icon_id.is_exist && launch_browser_tlv->user_confirm_icon_id.icon_qualifer != ICON_QUALI_SELF_EXPLANATORY)){
+ if (!launch_browser_tlv->user_confirm_alpha_id.is_exist &&
+ (launch_browser_tlv->user_confirm_icon_id.is_exist && launch_browser_tlv->user_confirm_icon_id.icon_qualifer != ICON_QUALI_SELF_EXPLANATORY)) {
struct treq_sat_terminal_rsp_data tr;
dbg("no alpha id and no self explanatory");
#if GCF_SAT_BROWSER_WITH_SINGLE_SESSION
b_app_running = sat_ui_check_app_is_running("org.tizen.browser");
#endif
- //browser launch type
+ /* browser launch type */
browser_launch_type = launch_browser_tlv->command_detail.cmd_qualifier.launch_browser.launch_browser;
/* ORA PLM P131004-00081:Launch browser while session already opened.
* therefore disabled here.
*/
#if GCF_SAT_BROWSER_WITH_SINGLE_SESSION
- if(browser_launch_type == LAUNCH_BROWSER_IF_NOT_ALREADY_LAUNCHED && b_app_running){
+ if (browser_launch_type == LAUNCH_BROWSER_IF_NOT_ALREADY_LAUNCHED && b_app_running) {
struct treq_sat_terminal_rsp_data tr;
dbg("browser is already running type(%d)", browser_launch_type);
sat_manager_send_terminal_response(ctx->comm, plg, &tr);
return NULL;
- }
- else if( (browser_launch_type == LAUNCH_BROWSER_USE_EXISTING_BROWSER || browser_launch_type == LAUNCH_BROWSER_CLOSE_AND_LAUNCH_NEW_BROWSER) && !b_app_running){
+ } else if ((browser_launch_type == LAUNCH_BROWSER_USE_EXISTING_BROWSER || browser_launch_type == LAUNCH_BROWSER_CLOSE_AND_LAUNCH_NEW_BROWSER) && !b_app_running) {
struct treq_sat_terminal_rsp_data tr;
dbg("browser is not running type(%d)", browser_launch_type);
}
#endif
- //browser id
+ /* browser id */
browser_id = launch_browser_tlv->browser_id;
- //url and url len
- if( launch_browser_tlv->url.url_length){
+ /* url and url len */
+ if (launch_browser_tlv->url.url_length) {
url_len = launch_browser_tlv->url.url_length;
memcpy(url, launch_browser_tlv->url.url, launch_browser_tlv->url.url_length);
- dbg("launch browser url (%s)",url);
+ dbg("launch browser url (%s)", url);
}
- //gateway_proxy_text
- if(launch_browser_tlv->gateway_proxy_text.is_digit_only) {
+ /* gateway_proxy_text */
+ if (launch_browser_tlv->gateway_proxy_text.is_digit_only) {
memcpy(gateway_proxy, launch_browser_tlv->gateway_proxy_text.string, launch_browser_tlv->gateway_proxy_text.string_length);
- dbg("launch browser gateway_proxy digit type string (%s)",gateway_proxy);
+ dbg("launch browser gateway_proxy digit type string (%s)", gateway_proxy);
} else {
- if( launch_browser_tlv->gateway_proxy_text.string_length){
- tcore_util_convert_string_to_utf8((unsigned char*)&gateway_proxy,(unsigned short *)&gateway_proxy_len,
+ if (launch_browser_tlv->gateway_proxy_text.string_length) {
+ tcore_util_convert_string_to_utf8((unsigned char*)&gateway_proxy, (unsigned short *)&gateway_proxy_len,
launch_browser_tlv->gateway_proxy_text.dcs.a_format,
(unsigned char*)&launch_browser_tlv->gateway_proxy_text.string,
(unsigned short)launch_browser_tlv->gateway_proxy_text.string_length);
- dbg("launch browser gateway_proxy_text (%s)",gateway_proxy);
+ dbg("launch browser gateway_proxy_text (%s)", gateway_proxy);
}
}
- //user confirm text and user confirm text len
- if( launch_browser_tlv->user_confirm_alpha_id.is_exist && launch_browser_tlv->user_confirm_alpha_id.alpha_data_len){
- tcore_util_convert_string_to_utf8((unsigned char*)&text,(unsigned short *)&text_len,
+ /* user confirm text and user confirm text len */
+ if (launch_browser_tlv->user_confirm_alpha_id.is_exist && launch_browser_tlv->user_confirm_alpha_id.alpha_data_len) {
+ tcore_util_convert_string_to_utf8((unsigned char*)&text, (unsigned short *)&text_len,
launch_browser_tlv->user_confirm_alpha_id.dcs.a_format,
(unsigned char*)&launch_browser_tlv->user_confirm_alpha_id.alpha_data,
(unsigned short)launch_browser_tlv->user_confirm_alpha_id.alpha_data_len);
- dbg("launch browser user confirm text (%s)",text);
+ dbg("launch browser user confirm text (%s)", text);
}
- //enqueue data and generate cmd_id
+ /* enqueue data and generate cmd_id */
memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
q_data.cmd_type = SAT_PROATV_CMD_LAUNCH_BROWSER;
q_data.cp_name = g_strdup(cp_name);
memcpy((void*)&(q_data.cmd_data.launch_browser), launch_browser_tlv, sizeof(struct tel_sat_launch_browser_tlv));
- if(FALSE == sat_manager_enqueue_cmd(ctx, &q_data)){
+ if (FALSE == sat_manager_enqueue_cmd(ctx, &q_data))
g_free(q_data.cp_name);
- }
command_id = q_data.cmd_id;
#if defined(TIZEN_SUPPORT_SAT_ICON)
/* Icon data extraction */
- g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE ("a(biiiiiis)"));
- if(launch_browser_tlv->user_confirm_icon_id.is_exist) {
+ g_variant_builder_init(&v_builder_icon, G_VARIANT_TYPE("a(biiiiiis)"));
+ if (launch_browser_tlv->user_confirm_icon_id.is_exist) {
g_variant_builder_add(&v_builder_icon, "(biiiiiis)", launch_browser_tlv->user_confirm_icon_id.is_exist, launch_browser_tlv->user_confirm_icon_id.icon_qualifer, (gint32) launch_browser_tlv->user_confirm_icon_id.icon_identifier, (gint32) launch_browser_tlv->user_confirm_icon_id.icon_info.width,
(gint32) launch_browser_tlv->user_confirm_icon_id.icon_info.height, launch_browser_tlv->user_confirm_icon_id.icon_info.ics, launch_browser_tlv->user_confirm_icon_id.icon_info.icon_data_len, launch_browser_tlv->user_confirm_icon_id.icon_info.icon_file);
}
TcorePlugin *plg = NULL;
GVariant *provide_info = NULL;
- gint info_type =0;
+ gint info_type = 0;
struct treq_sat_terminal_rsp_data *tr = NULL;
dbg("interpreting provide local info notification");
plg = tcore_server_find_plugin(ctx->server, cp_name);
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return NULL;
}
provide_info = g_variant_new("(i)", info_type);
- //send TR - does not need from application's response
+ /* send TR - does not need from application's response */
tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
if (!tr)
return NULL;
info_type = provide_local_info_tlv->command_detail.cmd_qualifier.provide_local_info.provide_local_info;
- switch(info_type){
- case LOCAL_INFO_DATE_TIME_AND_TIMEZONE:{
- int err = 0; int gmt = 0, n_flg = 0;
- struct timezone c_tz;
- struct timeval c_time;
+ switch (info_type) {
+ case LOCAL_INFO_DATE_TIME_AND_TIMEZONE:{
+ int err = 0; int gmt = 0, n_flg = 0;
+ struct timezone c_tz;
+ struct timeval c_time;
- time_t time_val;
- struct tm time_info;
+ time_t time_val;
+ struct tm time_info;
- time(&time_val);
+ time(&time_val);
- tzset();
- err = gettimeofday(&c_time, &c_tz);
- localtime_r(&time_val, &time_info);
+ tzset();
+ err = gettimeofday(&c_time, &c_tz);
+ localtime_r(&time_val, &time_info);
- //set the time information
- tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.year =
- _convert_decimal_to_bcd(time_info.tm_year+1900-2000);
+ /* set the time information */
+ tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.year =
+ _convert_decimal_to_bcd(time_info.tm_year+1900-2000);
- tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.month =
- _convert_decimal_to_bcd(time_info.tm_mon+1);
+ tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.month =
+ _convert_decimal_to_bcd(time_info.tm_mon+1);
- tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.day =
- _convert_decimal_to_bcd(time_info.tm_mday);
+ tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.day =
+ _convert_decimal_to_bcd(time_info.tm_mday);
- tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.hour =
- _convert_decimal_to_bcd(time_info.tm_hour);
+ tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.hour =
+ _convert_decimal_to_bcd(time_info.tm_hour);
- tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.minute =
- _convert_decimal_to_bcd(time_info.tm_min);
+ tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.minute =
+ _convert_decimal_to_bcd(time_info.tm_min);
- tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.second =
- _convert_decimal_to_bcd(time_info.tm_sec);
+ tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.second =
+ _convert_decimal_to_bcd(time_info.tm_sec);
- gmt = c_tz.tz_minuteswest/60;
- if(gmt < 0){
- gmt = gmt * -1;
- n_flg = 1;
- }
+ gmt = c_tz.tz_minuteswest / 60;
+ if (gmt < 0) {
+ gmt = gmt * -1;
+ n_flg = 1;
+ }
- if(err != 0){
- tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.timeZone = 0xFF;
- }
- else{
- tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.timeZone =
- _convert_decimal_to_bcd(gmt);
+ if (err != 0) {
+ tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.timeZone = 0xFF;
+ } else {
+ tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.timeZone =
+ _convert_decimal_to_bcd(gmt);
- if(n_flg == 1){
- tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.timeZone += 0x80;
- }
+ if (n_flg == 1)
+ tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.timeZone += 0x80;
- if(time_info.tm_isdst > 0){
- tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.timeZone += 0x40;
- }
- }
+ if (time_info.tm_isdst > 0)
+ tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.timeZone += 0x40;
+ }
- tr->terminal_rsp_data.provide_local_info.result_type = RESULT_SUCCESS;
- tr->terminal_rsp_data.provide_local_info.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ tr->terminal_rsp_data.provide_local_info.result_type = RESULT_SUCCESS;
+ tr->terminal_rsp_data.provide_local_info.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
} break;
- case LOCAL_INFO_LANGUAGE:{
- Server *s = NULL;
- static Storage *strg;
- gchar *lang_str = NULL;
- enum tel_sim_language_type lang_type = SIM_LANG_UNSPECIFIED;
-
- tr->terminal_rsp_data.provide_local_info.result_type = RESULT_SUCCESS;
- tr->terminal_rsp_data.provide_local_info.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
-
- s = ctx->server;
- strg = tcore_server_find_storage(s, "vconf");
- lang_str = tcore_storage_get_string(strg, STORAGE_KEY_LANGUAGE_SET);
- if(lang_str)
- lang_type = _convert_string_to_sim_lang(lang_str);
-
- tr->terminal_rsp_data.provide_local_info.other.language = lang_type;
+ case LOCAL_INFO_LANGUAGE:{
+ Server *s = NULL;
+ static Storage *strg;
+ gchar *lang_str = NULL;
+ enum tel_sim_language_type lang_type = SIM_LANG_UNSPECIFIED;
+
+ tr->terminal_rsp_data.provide_local_info.result_type = RESULT_SUCCESS;
+ tr->terminal_rsp_data.provide_local_info.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+
+ s = ctx->server;
+ strg = tcore_server_find_storage(s, "vconf");
+ lang_str = tcore_storage_get_string(strg, STORAGE_KEY_LANGUAGE_SET);
+ if (lang_str)
+ lang_type = _convert_string_to_sim_lang(lang_str);
+
+ tr->terminal_rsp_data.provide_local_info.other.language = lang_type;
} break;
- default :{
- tr->terminal_rsp_data.provide_local_info.other_info = FALSE;
- tr->terminal_rsp_data.provide_local_info.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- tr->terminal_rsp_data.provide_local_info.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ default: {
+ tr->terminal_rsp_data.provide_local_info.other_info = FALSE;
+ tr->terminal_rsp_data.provide_local_info.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+ tr->terminal_rsp_data.provide_local_info.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
} break;
}
struct sat_manager_queue_data q_data;
gint command_id = 0;
- gint language =0;
+ gint language = 0;
gboolean b_specified = FALSE;
dbg("interpreting langauge notification");
plg = tcore_server_find_plugin(ctx->server, cp_name);
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return NULL;
}
- if (language_notification_tlv->command_detail.cmd_qualifier.language_notification.specific_language == TRUE){
+ if (language_notification_tlv->command_detail.cmd_qualifier.language_notification.specific_language == TRUE) {
b_specified = TRUE;
language = language_notification_tlv->language;
} else {
b_specified = FALSE;
- language =SIM_LANG_UNSPECIFIED;
+ language = SIM_LANG_UNSPECIFIED;
}
- //enqueue data and generate cmd_id
+ /* enqueue data and generate cmd_id */
memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
q_data.cmd_type = SAT_PROATV_CMD_LANGUAGE_NOTIFICATION;
q_data.cp_name = g_strdup(cp_name);
memcpy((void*)&(q_data.cmd_data.language_notification), language_notification_tlv, sizeof(struct tel_sat_language_notification_tlv));
- if(FALSE == sat_manager_enqueue_cmd(ctx, &q_data)){
+ if (FALSE == sat_manager_enqueue_cmd(ctx, &q_data))
g_free(q_data.cp_name);
- }
command_id = q_data.cmd_id;
language_noti = g_variant_new("(iib)", command_id, language, b_specified);
dbg("[SAT] unsupport proactive command (%d)", unsupport_tlv->command_detail.cmd_type);
plg = tcore_server_find_plugin(ctx->server, cp_name);
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return FALSE;
}
dbg("[SAT] proactive command (%d)", p_ind->cmd_type);
plg = tcore_server_find_plugin(ctx->server, cp_name);
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return FALSE;
}
tr.cmd_type = p_ind->cmd_type;
switch (p_ind->cmd_type) {
- case SAT_PROATV_CMD_DISPLAY_TEXT: {
- memcpy((void*)&tr.terminal_rsp_data.display_text.command_detail, &p_ind->proactive_ind_data.display_text.command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr.terminal_rsp_data.display_text.device_id.src = DEVICE_ID_ME;
- tr.terminal_rsp_data.display_text.device_id.dest = DEVICE_ID_SIM;
- tr.terminal_rsp_data.display_text.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- } break;
- case SAT_PROATV_CMD_SELECT_ITEM: {
- memcpy((void*)&tr.terminal_rsp_data.select_item.command_detail, &p_ind->proactive_ind_data.select_item.command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr.terminal_rsp_data.select_item.device_id.src = DEVICE_ID_ME;
- tr.terminal_rsp_data.select_item.device_id.dest = DEVICE_ID_SIM;
- tr.terminal_rsp_data.select_item.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- } break;
- case SAT_PROATV_CMD_GET_INKEY: {
- memcpy((void*)&tr.terminal_rsp_data.get_inkey.command_detail, &p_ind->proactive_ind_data.get_inkey.command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr.terminal_rsp_data.get_inkey.device_id.src = DEVICE_ID_ME;
- tr.terminal_rsp_data.get_inkey.device_id.dest = DEVICE_ID_SIM;
- tr.terminal_rsp_data.get_inkey.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- } break;
- case SAT_PROATV_CMD_GET_INPUT: {
- memcpy((void*)&tr.terminal_rsp_data.get_input.command_detail, &p_ind->proactive_ind_data.get_input.command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr.terminal_rsp_data.get_input.device_id.src = DEVICE_ID_ME;
- tr.terminal_rsp_data.get_input.device_id.dest = DEVICE_ID_SIM;
- tr.terminal_rsp_data.get_input.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- } break;
- case SAT_PROATV_CMD_PLAY_TONE: {
- memcpy((void*)&tr.terminal_rsp_data.play_tone.command_detail, &p_ind->proactive_ind_data.play_tone.command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr.terminal_rsp_data.play_tone.device_id.src = DEVICE_ID_ME;
- tr.terminal_rsp_data.play_tone.device_id.dest = DEVICE_ID_SIM;
- tr.terminal_rsp_data.play_tone.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- } break;
- case SAT_PROATV_CMD_SEND_SMS: {
- memcpy((void*)&tr.terminal_rsp_data.send_sms.command_detail, &p_ind->proactive_ind_data.send_sms.command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr.terminal_rsp_data.send_sms.device_id.src = DEVICE_ID_ME;
- tr.terminal_rsp_data.send_sms.device_id.dest = DEVICE_ID_SIM;
- tr.terminal_rsp_data.send_sms.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- } break;
- case SAT_PROATV_CMD_SEND_SS: {
- memcpy((void*)&tr.terminal_rsp_data.send_ss.command_detail, &p_ind->proactive_ind_data.send_ss.command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr.terminal_rsp_data.send_ss.device_id.src = DEVICE_ID_ME;
- tr.terminal_rsp_data.send_ss.device_id.dest = DEVICE_ID_SIM;
- tr.terminal_rsp_data.send_ss.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- } break;
- case SAT_PROATV_CMD_SEND_USSD: {
- memcpy((void*)&tr.terminal_rsp_data.send_ussd.command_detail, &p_ind->proactive_ind_data.send_ussd.command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr.terminal_rsp_data.send_ussd.device_id.src = DEVICE_ID_ME;
- tr.terminal_rsp_data.send_ussd.device_id.dest = DEVICE_ID_SIM;
- tr.terminal_rsp_data.send_ussd.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- } break;
- case SAT_PROATV_CMD_SETUP_CALL: {
- memcpy((void*)&tr.terminal_rsp_data.setup_call.command_detail, &p_ind->proactive_ind_data.setup_call.command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr.terminal_rsp_data.setup_call.device_id.src = DEVICE_ID_ME;
- tr.terminal_rsp_data.setup_call.device_id.dest = DEVICE_ID_SIM;
- tr.terminal_rsp_data.setup_call.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- } break;
- case SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT: {
- memcpy((void*)&tr.terminal_rsp_data.setup_idle_mode_text.command_detail, &p_ind->proactive_ind_data.setup_idle_mode_text.command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr.terminal_rsp_data.setup_idle_mode_text.device_id.src = DEVICE_ID_ME;
- tr.terminal_rsp_data.setup_idle_mode_text.device_id.dest = DEVICE_ID_SIM;
- tr.terminal_rsp_data.setup_idle_mode_text.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- } break;
- case SAT_PROATV_CMD_OPEN_CHANNEL: {
- memcpy((void*)&tr.terminal_rsp_data.open_channel.command_detail, &p_ind->proactive_ind_data.open_channel.command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr.terminal_rsp_data.open_channel.device_id.src = DEVICE_ID_ME;
- tr.terminal_rsp_data.open_channel.device_id.dest = DEVICE_ID_SIM;
- tr.terminal_rsp_data.open_channel.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- } break;
- case SAT_PROATV_CMD_LAUNCH_BROWSER: {
- memcpy((void*)&tr.terminal_rsp_data.launch_browser.command_detail, &p_ind->proactive_ind_data.launch_browser.command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr.terminal_rsp_data.launch_browser.device_id.src = DEVICE_ID_ME;
- tr.terminal_rsp_data.launch_browser.device_id.dest = DEVICE_ID_SIM;
- tr.terminal_rsp_data.launch_browser.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- } break;
- default:
- dbg("unsupported command.");
- break;
+ case SAT_PROATV_CMD_DISPLAY_TEXT: {
+ memcpy((void*)&tr.terminal_rsp_data.display_text.command_detail, &p_ind->proactive_ind_data.display_text.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+ tr.terminal_rsp_data.display_text.device_id.src = DEVICE_ID_ME;
+ tr.terminal_rsp_data.display_text.device_id.dest = DEVICE_ID_SIM;
+ tr.terminal_rsp_data.display_text.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+ } break;
+ case SAT_PROATV_CMD_SELECT_ITEM: {
+ memcpy((void*)&tr.terminal_rsp_data.select_item.command_detail, &p_ind->proactive_ind_data.select_item.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+ tr.terminal_rsp_data.select_item.device_id.src = DEVICE_ID_ME;
+ tr.terminal_rsp_data.select_item.device_id.dest = DEVICE_ID_SIM;
+ tr.terminal_rsp_data.select_item.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+ } break;
+ case SAT_PROATV_CMD_GET_INKEY: {
+ memcpy((void*)&tr.terminal_rsp_data.get_inkey.command_detail, &p_ind->proactive_ind_data.get_inkey.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+ tr.terminal_rsp_data.get_inkey.device_id.src = DEVICE_ID_ME;
+ tr.terminal_rsp_data.get_inkey.device_id.dest = DEVICE_ID_SIM;
+ tr.terminal_rsp_data.get_inkey.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+ } break;
+ case SAT_PROATV_CMD_GET_INPUT: {
+ memcpy((void*)&tr.terminal_rsp_data.get_input.command_detail, &p_ind->proactive_ind_data.get_input.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+ tr.terminal_rsp_data.get_input.device_id.src = DEVICE_ID_ME;
+ tr.terminal_rsp_data.get_input.device_id.dest = DEVICE_ID_SIM;
+ tr.terminal_rsp_data.get_input.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+ } break;
+ case SAT_PROATV_CMD_PLAY_TONE: {
+ memcpy((void*)&tr.terminal_rsp_data.play_tone.command_detail, &p_ind->proactive_ind_data.play_tone.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+ tr.terminal_rsp_data.play_tone.device_id.src = DEVICE_ID_ME;
+ tr.terminal_rsp_data.play_tone.device_id.dest = DEVICE_ID_SIM;
+ tr.terminal_rsp_data.play_tone.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+ } break;
+ case SAT_PROATV_CMD_SEND_SMS: {
+ memcpy((void*)&tr.terminal_rsp_data.send_sms.command_detail, &p_ind->proactive_ind_data.send_sms.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+ tr.terminal_rsp_data.send_sms.device_id.src = DEVICE_ID_ME;
+ tr.terminal_rsp_data.send_sms.device_id.dest = DEVICE_ID_SIM;
+ tr.terminal_rsp_data.send_sms.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+ } break;
+ case SAT_PROATV_CMD_SEND_SS: {
+ memcpy((void*)&tr.terminal_rsp_data.send_ss.command_detail, &p_ind->proactive_ind_data.send_ss.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+ tr.terminal_rsp_data.send_ss.device_id.src = DEVICE_ID_ME;
+ tr.terminal_rsp_data.send_ss.device_id.dest = DEVICE_ID_SIM;
+ tr.terminal_rsp_data.send_ss.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+ } break;
+ case SAT_PROATV_CMD_SEND_USSD: {
+ memcpy((void*)&tr.terminal_rsp_data.send_ussd.command_detail, &p_ind->proactive_ind_data.send_ussd.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+ tr.terminal_rsp_data.send_ussd.device_id.src = DEVICE_ID_ME;
+ tr.terminal_rsp_data.send_ussd.device_id.dest = DEVICE_ID_SIM;
+ tr.terminal_rsp_data.send_ussd.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+ } break;
+ case SAT_PROATV_CMD_SETUP_CALL: {
+ memcpy((void*)&tr.terminal_rsp_data.setup_call.command_detail, &p_ind->proactive_ind_data.setup_call.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+ tr.terminal_rsp_data.setup_call.device_id.src = DEVICE_ID_ME;
+ tr.terminal_rsp_data.setup_call.device_id.dest = DEVICE_ID_SIM;
+ tr.terminal_rsp_data.setup_call.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+ } break;
+ case SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT: {
+ memcpy((void*)&tr.terminal_rsp_data.setup_idle_mode_text.command_detail, &p_ind->proactive_ind_data.setup_idle_mode_text.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+ tr.terminal_rsp_data.setup_idle_mode_text.device_id.src = DEVICE_ID_ME;
+ tr.terminal_rsp_data.setup_idle_mode_text.device_id.dest = DEVICE_ID_SIM;
+ tr.terminal_rsp_data.setup_idle_mode_text.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+ } break;
+ case SAT_PROATV_CMD_OPEN_CHANNEL: {
+ memcpy((void*)&tr.terminal_rsp_data.open_channel.command_detail, &p_ind->proactive_ind_data.open_channel.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+ tr.terminal_rsp_data.open_channel.device_id.src = DEVICE_ID_ME;
+ tr.terminal_rsp_data.open_channel.device_id.dest = DEVICE_ID_SIM;
+ tr.terminal_rsp_data.open_channel.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+ } break;
+ case SAT_PROATV_CMD_LAUNCH_BROWSER: {
+ memcpy((void*)&tr.terminal_rsp_data.launch_browser.command_detail, &p_ind->proactive_ind_data.launch_browser.command_detail, sizeof(struct tel_sat_cmd_detail_info));
+ tr.terminal_rsp_data.launch_browser.device_id.src = DEVICE_ID_ME;
+ tr.terminal_rsp_data.launch_browser.device_id.dest = DEVICE_ID_SIM;
+ tr.terminal_rsp_data.launch_browser.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+ } break;
+ default:
+ dbg("unsupported command.");
+ break;
}
rv = sat_manager_send_terminal_response(ctx->comm, plg, &tr);
- if(rv != TCORE_RETURN_SUCCESS)
+ if (rv != TCORE_RETURN_SUCCESS)
return FALSE;
return TRUE;
return result;
}
- if(!exec_result){
+ if (!exec_result) {
dbg("[SAT] setup menu result data is null");
return result;
}
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return result;
}
dbg("[SAT] resp(%d)", resp);
- switch(resp){
- case RESULT_SUCCESS:
- tr->terminal_rsp_data.setup_menu.result_type = RESULT_SUCCESS;
+ switch (resp) {
+ case RESULT_SUCCESS:
+ tr->terminal_rsp_data.setup_menu.result_type = RESULT_SUCCESS;
- if(q_data.cmd_data.setupMenuInd.text_attribute.b_txt_attr || q_data.cmd_data.setupMenuInd.text_attribute_list.list_cnt > 0)
- tr->terminal_rsp_data.setup_menu.result_type = RESULT_SUCCESS_WITH_PARTIAL_COMPREHENSION;
+ if (q_data.cmd_data.setupMenuInd.text_attribute.b_txt_attr || q_data.cmd_data.setupMenuInd.text_attribute_list.list_cnt > 0)
+ tr->terminal_rsp_data.setup_menu.result_type = RESULT_SUCCESS_WITH_PARTIAL_COMPREHENSION;
- if(q_data.cmd_data.setupMenuInd.icon_id.is_exist)
- tr->terminal_rsp_data.setup_menu.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+ if (q_data.cmd_data.setupMenuInd.icon_id.is_exist)
+ tr->terminal_rsp_data.setup_menu.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
- tr->terminal_rsp_data.setup_menu.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
+ tr->terminal_rsp_data.setup_menu.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ break;
- case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
- tr->terminal_rsp_data.setup_menu.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- tr->terminal_rsp_data.setup_menu.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
+ case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+ tr->terminal_rsp_data.setup_menu.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+ tr->terminal_rsp_data.setup_menu.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ break;
- default:
- //check the default case
- tr->terminal_rsp_data.setup_menu.result_type = resp;
- tr->terminal_rsp_data.setup_menu.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- dbg("[SAT] wrong result from app exec resp(%d)", resp);
- break;
+ default:
+ /* check the default case */
+ tr->terminal_rsp_data.setup_menu.result_type = resp;
+ tr->terminal_rsp_data.setup_menu.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ dbg("[SAT] wrong result from app exec resp(%d)", resp);
+ break;
}
result = TRUE;
rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
+ if (rv != TCORE_RETURN_SUCCESS) {
dbg("fail to send terminal response");
result = FALSE;
}
return result;
}
- if(!exec_result){
+ if (!exec_result) {
dbg("[SAT] display text result data is null");
return result;
}
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return result;
}
dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
- g_variant_get(exec_result, "(ii)",&resp, &me_problem);
+ g_variant_get(exec_result, "(ii)", &resp, &me_problem);
tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
if (!tr)
tr->terminal_rsp_data.display_text.device_id.dest = DEVICE_ID_SIM;
switch (resp) {
- case RESULT_SUCCESS:
- tr->terminal_rsp_data.display_text.result_type = RESULT_SUCCESS;
+ case RESULT_SUCCESS:
+ tr->terminal_rsp_data.display_text.result_type = RESULT_SUCCESS;
- if(q_data.cmd_data.displayTextInd.text_attribute.b_txt_attr)
- tr->terminal_rsp_data.display_text.result_type = RESULT_SUCCESS_WITH_PARTIAL_COMPREHENSION;
+ if (q_data.cmd_data.displayTextInd.text_attribute.b_txt_attr)
+ tr->terminal_rsp_data.display_text.result_type = RESULT_SUCCESS_WITH_PARTIAL_COMPREHENSION;
- if (q_data.cmd_data.displayTextInd.icon_id.is_exist)
- tr->terminal_rsp_data.display_text.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+ if (q_data.cmd_data.displayTextInd.icon_id.is_exist)
+ tr->terminal_rsp_data.display_text.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
- tr->terminal_rsp_data.display_text.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
+ tr->terminal_rsp_data.display_text.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ break;
- case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
- tr->terminal_rsp_data.display_text.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- tr->terminal_rsp_data.display_text.me_problem_type = me_problem;
- break;
+ case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+ tr->terminal_rsp_data.display_text.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+ tr->terminal_rsp_data.display_text.me_problem_type = me_problem;
+ break;
- default:
- tr->terminal_rsp_data.display_text.result_type = resp;
- tr->terminal_rsp_data.display_text.me_problem_type = me_problem;
- dbg("[SAT] wrong result from app exec resp(%d) me_problem(%d)", resp, me_problem);
- break;
+ default:
+ tr->terminal_rsp_data.display_text.result_type = resp;
+ tr->terminal_rsp_data.display_text.me_problem_type = me_problem;
+ dbg("[SAT] wrong result from app exec resp(%d) me_problem(%d)", resp, me_problem);
+ break;
}
result = TRUE;
rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
+ if (rv != TCORE_RETURN_SUCCESS) {
dbg("fail to send terminal response");
result = FALSE;
}
return result;
}
- if(!exec_result){
+ if (!exec_result) {
dbg("[SAT] display text result data is null");
return result;
}
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return result;
}
dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
- g_variant_get(exec_result, "(i)",&resp);
+ g_variant_get(exec_result, "(i)", &resp);
tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
if (!tr)
tr->terminal_rsp_data.play_tone.device_id.dest = DEVICE_ID_SIM;
switch (resp) {
- case RESULT_SUCCESS:
- tr->terminal_rsp_data.play_tone.result_type = RESULT_SUCCESS;
+ case RESULT_SUCCESS:
+ tr->terminal_rsp_data.play_tone.result_type = RESULT_SUCCESS;
- if(q_data.cmd_data.play_tone.text_attribute.b_txt_attr)
- tr->terminal_rsp_data.play_tone.result_type = RESULT_SUCCESS_WITH_PARTIAL_COMPREHENSION;
+ if (q_data.cmd_data.play_tone.text_attribute.b_txt_attr)
+ tr->terminal_rsp_data.play_tone.result_type = RESULT_SUCCESS_WITH_PARTIAL_COMPREHENSION;
- if (q_data.cmd_data.play_tone.icon_id.is_exist)
- tr->terminal_rsp_data.play_tone.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+ if (q_data.cmd_data.play_tone.icon_id.is_exist)
+ tr->terminal_rsp_data.play_tone.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
- tr->terminal_rsp_data.play_tone.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
+ tr->terminal_rsp_data.play_tone.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ break;
- case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
- tr->terminal_rsp_data.play_tone.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- tr->terminal_rsp_data.play_tone.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
+ case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+ tr->terminal_rsp_data.play_tone.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+ tr->terminal_rsp_data.play_tone.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ break;
- case RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER:
- tr->terminal_rsp_data.play_tone.result_type = RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
- tr->terminal_rsp_data.play_tone.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
+ case RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER:
+ tr->terminal_rsp_data.play_tone.result_type = RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
+ tr->terminal_rsp_data.play_tone.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ break;
- default:
- tr->terminal_rsp_data.play_tone.result_type = resp;
- tr->terminal_rsp_data.play_tone.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- dbg("[SAT] wrong result from app exec resp(%d)", resp);
- break;
+ default:
+ tr->terminal_rsp_data.play_tone.result_type = resp;
+ tr->terminal_rsp_data.play_tone.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ dbg("[SAT] wrong result from app exec resp(%d)", resp);
+ break;
}
result = TRUE;
rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
+ if (rv != TCORE_RETURN_SUCCESS) {
dbg("fail to send terminal response");
result = FALSE;
}
return result;
}
- if(!exec_result){
+ if (!exec_result) {
dbg("[SAT] send sms data is null");
return result;
}
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return result;
}
dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
- g_variant_get(exec_result, "(i)",&resp);
+ g_variant_get(exec_result, "(i)", &resp);
tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
if (!tr)
tr->terminal_rsp_data.send_sms.device_id.dest = q_data.cmd_data.sendSMSInd.device_id.src;
switch (resp) {
- case RESULT_SUCCESS:
- tr->terminal_rsp_data.send_sms.result_type = RESULT_SUCCESS;
- if (q_data.cmd_data.sendSMSInd.icon_id.is_exist)
- tr->terminal_rsp_data.send_sms.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+ case RESULT_SUCCESS:
+ tr->terminal_rsp_data.send_sms.result_type = RESULT_SUCCESS;
+ if (q_data.cmd_data.sendSMSInd.icon_id.is_exist)
+ tr->terminal_rsp_data.send_sms.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
- break;
+ break;
- case RESULT_INTRCTN_WITH_CC_OR_SMS_CTRL_PRMNT_PRBLM:
- tr->terminal_rsp_data.send_sms.result_type = RESULT_INTRCTN_WITH_CC_OR_SMS_CTRL_PRMNT_PRBLM;
- tr->terminal_rsp_data.send_sms.cc_problem_type = CC_PROBLEM_ACTION_NOT_ALLOWED;
- break;
+ case RESULT_INTRCTN_WITH_CC_OR_SMS_CTRL_PRMNT_PRBLM:
+ tr->terminal_rsp_data.send_sms.result_type = RESULT_INTRCTN_WITH_CC_OR_SMS_CTRL_PRMNT_PRBLM;
+ tr->terminal_rsp_data.send_sms.cc_problem_type = CC_PROBLEM_ACTION_NOT_ALLOWED;
+ break;
- case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
- tr->terminal_rsp_data.send_sms.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- tr->terminal_rsp_data.send_sms.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
+ case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+ tr->terminal_rsp_data.send_sms.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+ tr->terminal_rsp_data.send_sms.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ break;
- case RESULT_BEYOND_ME_CAPABILITIES:
- tr->terminal_rsp_data.send_sms.result_type = RESULT_BEYOND_ME_CAPABILITIES;
- tr->terminal_rsp_data.send_sms.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
+ case RESULT_BEYOND_ME_CAPABILITIES:
+ tr->terminal_rsp_data.send_sms.result_type = RESULT_BEYOND_ME_CAPABILITIES;
+ tr->terminal_rsp_data.send_sms.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ break;
- case RESULT_COMMAND_TYPE_NOT_UNDERSTOOD_BY_ME:
- tr->terminal_rsp_data.send_sms.result_type = RESULT_COMMAND_TYPE_NOT_UNDERSTOOD_BY_ME;
- tr->terminal_rsp_data.send_sms.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
+ case RESULT_COMMAND_TYPE_NOT_UNDERSTOOD_BY_ME:
+ tr->terminal_rsp_data.send_sms.result_type = RESULT_COMMAND_TYPE_NOT_UNDERSTOOD_BY_ME;
+ tr->terminal_rsp_data.send_sms.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ break;
- case RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME:
- tr->terminal_rsp_data.send_sms.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
- tr->terminal_rsp_data.send_sms.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
+ case RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME:
+ tr->terminal_rsp_data.send_sms.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
+ tr->terminal_rsp_data.send_sms.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ break;
- case RESULT_ERROR_REQUIRED_VALUES_ARE_MISSING:
- tr->terminal_rsp_data.send_sms.result_type = RESULT_ERROR_REQUIRED_VALUES_ARE_MISSING;
- tr->terminal_rsp_data.send_sms.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
+ case RESULT_ERROR_REQUIRED_VALUES_ARE_MISSING:
+ tr->terminal_rsp_data.send_sms.result_type = RESULT_ERROR_REQUIRED_VALUES_ARE_MISSING;
+ tr->terminal_rsp_data.send_sms.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ break;
- case RESULT_SMS_RP_ERROR:
- tr->terminal_rsp_data.send_sms.result_type = RESULT_SMS_RP_ERROR;
- tr->terminal_rsp_data.send_sms.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
+ case RESULT_SMS_RP_ERROR:
+ tr->terminal_rsp_data.send_sms.result_type = RESULT_SMS_RP_ERROR;
+ tr->terminal_rsp_data.send_sms.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ break;
- default:
- tr->terminal_rsp_data.send_sms.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- tr->terminal_rsp_data.send_sms.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
+ case RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
+ tr->terminal_rsp_data.send_sms.result_type = RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND;
+ tr->terminal_rsp_data.send_sms.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ break;
+
+ default:
+ tr->terminal_rsp_data.send_sms.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+ tr->terminal_rsp_data.send_sms.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ break;
}
result = TRUE;
rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
+ if (rv != TCORE_RETURN_SUCCESS) {
dbg("fail to send terminal response");
result = FALSE;
}
g_free(tr);
-/* if( q_data.cmd_data.sendSMSInd.alpha_id.alpha_data_len && q_data.cmd_data.sendSMSInd.alpha_id.is_exist)
+/* if (q_data.cmd_data.sendSMSInd.alpha_id.alpha_data_len && q_data.cmd_data.sendSMSInd.alpha_id.is_exist)
sat_ui_support_terminate_sat_ui();*/
return result;
GVariant *ss_str = NULL;
struct treq_sat_terminal_rsp_data *tr;
struct sat_manager_queue_data q_data;
- //call ctrl action, result data object, text
+ /* call ctrl action, result data object, text */
memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
return result;
}
- if(!exec_result){
+ if (!exec_result) {
dbg("[SAT] send ss data is null");
return result;
}
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return result;
}
tr->terminal_rsp_data.send_ss.device_id.dest = q_data.cmd_data.send_ss.device_id.src;
switch (resp) {
- case RESULT_SUCCESS:
- tr->terminal_rsp_data.send_ss.result_type = RESULT_SUCCESS;
- if (q_data.cmd_data.send_ss.icon_id.is_exist)
- tr->terminal_rsp_data.send_ss.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
-
- if(ss_str_len > 0 && ss_str){
- int local_index = 0;
- guchar data;
- GVariantIter *iter = NULL;
- GVariant *intermediate = NULL;
- char *tmp = NULL;
-
- intermediate = g_variant_get_variant(ss_str);
- dbg("ss string format(%s)", g_variant_get_type_string(intermediate));
-
- g_variant_get(intermediate, "ay", &iter);
- while( g_variant_iter_loop (iter, "y", &data)){
- dbg("index(%d) data(%c)", local_index, data);
- tr->terminal_rsp_data.send_ss.text.string[local_index] = data;
- local_index++;
- }
- g_variant_iter_free(iter);
- g_variant_unref(intermediate);
-
- tr->terminal_rsp_data.send_ss.text.string_length = local_index;
- tmp = _convert_hex_string_to_bytes(tr->terminal_rsp_data.send_ss.text.string);
- memset(tr->terminal_rsp_data.send_ss.text.string, 0x00,
- sizeof(tr->terminal_rsp_data.send_ss.text.string));
- if(tmp) {
- memcpy(tr->terminal_rsp_data.send_ss.text.string, tmp,
- tr->terminal_rsp_data.send_ss.text.string_length);
- g_free(tmp);
- }
- else {
- err("memcpy failed");
- }
- dbg("SS string len:%d", tr->terminal_rsp_data.send_ss.text.string_length);
+ case RESULT_SUCCESS:
+ tr->terminal_rsp_data.send_ss.result_type = RESULT_SUCCESS;
+ if (q_data.cmd_data.send_ss.icon_id.is_exist)
+ tr->terminal_rsp_data.send_ss.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+
+ if (ss_str_len > 0 && ss_str) {
+ int local_index = 0;
+ guchar data;
+ GVariantIter *iter = NULL;
+ GVariant *intermediate = NULL;
+ char *tmp = NULL;
+
+ intermediate = g_variant_get_variant(ss_str);
+ dbg("ss string format(%s)", g_variant_get_type_string(intermediate));
+
+ g_variant_get(intermediate, "ay", &iter);
+ while (g_variant_iter_loop(iter, "y", &data)) {
+ dbg("index(%d) data(%c)", local_index, data);
+ tr->terminal_rsp_data.send_ss.text.string[local_index] = data;
+ local_index++;
}
- break;
+ g_variant_iter_free(iter);
+ g_variant_unref(intermediate);
+
+ tr->terminal_rsp_data.send_ss.text.string_length = local_index/2;
+ tmp = _convert_hex_string_to_bytes(tr->terminal_rsp_data.send_ss.text.string);
+ memset(tr->terminal_rsp_data.send_ss.text.string, 0x00,
+ sizeof(tr->terminal_rsp_data.send_ss.text.string));
+ if (tmp) {
+ memcpy(tr->terminal_rsp_data.send_ss.text.string, tmp,
+ tr->terminal_rsp_data.send_ss.text.string_length);
+ g_free(tmp);
+ } else {
+ err("memcpy failed");
+ }
+ dbg("SS string len:%d", tr->terminal_rsp_data.send_ss.text.string_length);
+ }
+ break;
- case RESULT_SS_RETURN_ERROR:
- tr->terminal_rsp_data.send_ss.result_type = RESULT_SS_RETURN_ERROR;
- if (ss_cause == SATK_SS_PROBLEM_FACILITY_NOT_SUPPORTED) {
- tr->terminal_rsp_data.send_ss.ss_problem = SATK_SS_PROBLEM_FACILITY_NOT_SUPPORTED;
- } else {
- tr->terminal_rsp_data.send_ss.ss_problem = SATK_SS_PROBLEM_NO_SPECIFIC_CAUSE;
- }
- break;
+ case RESULT_SS_RETURN_ERROR:
+ tr->terminal_rsp_data.send_ss.result_type = RESULT_SS_RETURN_ERROR;
+ if (ss_cause == SATK_SS_PROBLEM_FACILITY_NOT_SUPPORTED)
+ tr->terminal_rsp_data.send_ss.ss_problem = SATK_SS_PROBLEM_FACILITY_NOT_SUPPORTED;
+ else
+ tr->terminal_rsp_data.send_ss.ss_problem = SATK_SS_PROBLEM_NO_SPECIFIC_CAUSE;
+ break;
- case RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
- tr->terminal_rsp_data.send_ss.result_type = RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND;
- tr->terminal_rsp_data.send_ss.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
+ case RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
+ tr->terminal_rsp_data.send_ss.result_type = RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND;
+ tr->terminal_rsp_data.send_ss.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ break;
- default:
- tr->terminal_rsp_data.send_ss.result_type = RESULT_SS_RETURN_ERROR;
- tr->terminal_rsp_data.send_ss.ss_problem = SATK_SS_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
+ default:
+ tr->terminal_rsp_data.send_ss.result_type = RESULT_SS_RETURN_ERROR;
+ tr->terminal_rsp_data.send_ss.ss_problem = SATK_SS_PROBLEM_NO_SPECIFIC_CAUSE;
+ break;
}
result = TRUE;
rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
+ if (rv != TCORE_RETURN_SUCCESS) {
dbg("fail to send terminal response");
result = FALSE;
}
g_free(tr);
#if defined(TIZEN_PLATFORM_USE_QCOM_QMI)
- if( q_data.cmd_data.send_ss.alpha_id.alpha_data_len && q_data.cmd_data.send_ss.alpha_id.is_exist ) {
+ if (q_data.cmd_data.send_ss.alpha_id.alpha_data_len && q_data.cmd_data.send_ss.alpha_id.is_exist) {
char *path;
const gchar *cp_name;
TelephonySAT *sat;
GVariant *ussd_str = NULL;
struct treq_sat_terminal_rsp_data *tr;
struct sat_manager_queue_data q_data;
- //call ctrl action, result data object, text, result2, text2
+ /* call ctrl action, result data object, text, result2, text2 */
memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
return result;
}
- if(!exec_result){
+ if (!exec_result) {
dbg("[SAT] send ss data is null");
return result;
}
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return result;
}
tr->terminal_rsp_data.send_ussd.device_id.dest = q_data.cmd_data.send_ussd.device_id.src;
switch (resp) {
- case RESULT_SUCCESS:
- tr->terminal_rsp_data.send_ussd.result_type = RESULT_SUCCESS;
- if (q_data.cmd_data.send_ussd.icon_id.is_exist)
- tr->terminal_rsp_data.send_ussd.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
-
- if(ussd_str_len > 0 && ussd_str){
- int local_index = 0, i = 0;
- guchar data;
- GVariantIter *iter = NULL;
- GVariant *intermediate = NULL;
- enum alphabet_format alpha_format;
-
- intermediate = g_variant_get_variant(ussd_str);
- dbg("ussd string format(%s)", g_variant_get_type_string(intermediate));
-
- g_variant_get(intermediate, "ay", &iter);
- while( g_variant_iter_loop (iter, "y", &data)){
- dbg("local_index(%d) data(%c)", local_index, data);
- tr->terminal_rsp_data.send_ussd.text.string[local_index] = data;
- local_index++;
- }
-
- if(local_index >=1 )
- tr->terminal_rsp_data.send_ussd.text.string_length = local_index-1;
- tr->terminal_rsp_data.send_ussd.text.dcs.raw_dcs = q_data.cmd_data.send_ussd.ussd_string.dsc.raw_dcs;
- /*bits 2 & 3 indicate the character set being used */
- switch (tr->terminal_rsp_data.send_ussd.text.dcs.raw_dcs & 0x0C) {
- case 0x00:
- case 0x0C:
- alpha_format = ALPHABET_FORMAT_SMS_DEFAULT;
- break;
-
- case 0x04:
- alpha_format = ALPHABET_FORMAT_8BIT_DATA;
- break;
-
- case 0X08:
- alpha_format = ALPHABET_FORMAT_UCS2;
- break;
-
- default:
- alpha_format = ALPHABET_FORMAT_RESERVED;
- break;
- }
- dbg("string :[%s] len:[%d] dcs:[%d] alpha_format:[%d]", tr->terminal_rsp_data.send_ussd.text.string, tr->terminal_rsp_data.send_ussd.text.string_length,
- tr->terminal_rsp_data.send_ussd.text.dcs.raw_dcs, alpha_format);
- g_variant_iter_free(iter);
- g_variant_unref(intermediate);
- switch(alpha_format){
- case ALPHABET_FORMAT_SMS_DEFAULT:
- /* As per the test spec TS 151.010-04 raw dcs for SMS default is 0 */
- tr->terminal_rsp_data.send_ussd.text.dcs.raw_dcs = ALPHABET_FORMAT_SMS_DEFAULT;
- if (tr->terminal_rsp_data.send_ussd.text.string_length > 0){
- int tmp_len;
- char tmp_str[SAT_TEXT_STRING_LEN_MAX + 1];
- char *packed_data;
-
- dbg("UTF 8 to GSM SMS default");
- tcore_util_convert_utf8_to_gsm((unsigned char*)tmp_str, &tmp_len,
- (unsigned char*)tr->terminal_rsp_data.send_ussd.text.string,
- tr->terminal_rsp_data.send_ussd.text.string_length);
- packed_data = (char*) tcore_util_pack_gsm7bit((const unsigned char *)tmp_str, tmp_len);
- memset(tr->terminal_rsp_data.send_ussd.text.string, 0x00,
- sizeof(tr->terminal_rsp_data.send_ussd.text.string));
- if(packed_data){
- memcpy((void*)tr->terminal_rsp_data.send_ussd.text.string, packed_data, strlen(packed_data));
- tr->terminal_rsp_data.send_ussd.text.string_length = strlen(packed_data);
- g_free(packed_data);
- }
- }
- dbg("final ussd len:%d", tr->terminal_rsp_data.send_ussd.text.string_length);
- for(i = 0; i< tr->terminal_rsp_data.send_ussd.text.string_length; i++)
- dbg("string :%c \n", tr->terminal_rsp_data.send_ussd.text.string[i]);
- break;
- case ALPHABET_FORMAT_8BIT_DATA: {
- gint output_data_len = 0;
- gchar output_data[SAT_USSD_STRING_LEN_MAX];
- dbg("UTF 8 to GSM 8 BIT DATA");
- tcore_util_convert_utf8_to_gsm((unsigned char*)output_data,&output_data_len,
- (unsigned char*)tr->terminal_rsp_data.send_ussd.text.string,
- tr->terminal_rsp_data.send_ussd.text.string_length);
- memset(tr->terminal_rsp_data.send_ussd.text.string, 0x00,
- sizeof(tr->terminal_rsp_data.send_ussd.text.string));
- if(output_data_len > 0){
- memcpy((void*)tr->terminal_rsp_data.send_ussd.text.string, output_data, output_data_len);
- tr->terminal_rsp_data.send_ussd.text.string_length = output_data_len;
- }
- dbg("final ussd len:%d", tr->terminal_rsp_data.send_ussd.text.string_length);
- for(i = 0; i< tr->terminal_rsp_data.send_ussd.text.string_length; i++)
- dbg("string :%c \n", tr->terminal_rsp_data.send_ussd.text.string[i]);
- }
- break;
- case ALPHABET_FORMAT_UCS2: {
- char *tmp = NULL;
- int str_len = 0;
- dbg("UCS2 DATA");
- tcore_util_convert_utf8_to_ucs2(&tmp,
- &str_len, (unsigned char*)tr->terminal_rsp_data.send_ussd.text.string,
- tr->terminal_rsp_data.send_ussd.text.string_length);
- memset(tr->terminal_rsp_data.send_ussd.text.string, 0x00,
- sizeof(tr->terminal_rsp_data.send_ussd.text.string));
- memcpy(tr->terminal_rsp_data.send_ussd.text.string, tmp, str_len);
- tr->terminal_rsp_data.send_ussd.text.string_length = str_len;
- dbg("final ussd len:%d", tr->terminal_rsp_data.send_ussd.text.string_length);
- for(i = 0; i< tr->terminal_rsp_data.send_ussd.text.string_length; i++)
- dbg("string :%c \n", tr->terminal_rsp_data.send_ussd.text.string[i]);
- g_free(tmp);
- }
- break;
- default:
- break;
- }
+ case RESULT_SUCCESS:
+ tr->terminal_rsp_data.send_ussd.result_type = RESULT_SUCCESS;
+ if (q_data.cmd_data.send_ussd.icon_id.is_exist)
+ tr->terminal_rsp_data.send_ussd.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+
+ if (ussd_str_len > 0 && ussd_str) {
+ int local_index = 0, i = 0;
+ guchar data;
+ GVariantIter *iter = NULL;
+ GVariant *intermediate = NULL;
+ enum alphabet_format alpha_format;
+
+ intermediate = g_variant_get_variant(ussd_str);
+ dbg("ussd string format(%s)", g_variant_get_type_string(intermediate));
+
+ g_variant_get(intermediate, "ay", &iter);
+ while (g_variant_iter_loop(iter, "y", &data)) {
+ dbg("local_index(%d) data(%c)", local_index, data);
+ tr->terminal_rsp_data.send_ussd.text.string[local_index] = data;
+ local_index++;
}
- break;
- case RESULT_SS_RETURN_ERROR:
- case RESULT_USSD_RETURN_ERROR:
- tr->terminal_rsp_data.send_ussd.result_type = RESULT_USSD_RETURN_ERROR;
- if(ss_cause == SATK_USSD_PROBLEM_UNKNOWN_ALPHABET)
- tr->terminal_rsp_data.send_ussd.ussd_problem = ss_cause;
+ if (local_index >= 1)
+ tr->terminal_rsp_data.send_ussd.text.string_length = local_index - 1;
+ tr->terminal_rsp_data.send_ussd.text.dcs.raw_dcs = q_data.cmd_data.send_ussd.ussd_string.dsc.raw_dcs;
+ /* bits 2 & 3 indicate the character set being used */
+ switch (tr->terminal_rsp_data.send_ussd.text.dcs.raw_dcs & 0x0C) {
+ case 0x00:
+ case 0x0C:
+ alpha_format = ALPHABET_FORMAT_SMS_DEFAULT;
+ break;
- break;
+ case 0x04:
+ alpha_format = ALPHABET_FORMAT_8BIT_DATA;
+ break;
- case RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
- tr->terminal_rsp_data.send_ussd.result_type = RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND;
- tr->terminal_rsp_data.send_ussd.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
+ case 0X08:
+ alpha_format = ALPHABET_FORMAT_UCS2;
+ break;
- case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
- tr->terminal_rsp_data.send_ussd.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- tr->terminal_rsp_data.send_ussd.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
+ default:
+ alpha_format = ALPHABET_FORMAT_RESERVED;
+ break;
+ }
+ dbg("string :[%s] len:[%d] dcs:[%d] alpha_format:[%d]",
+ tr->terminal_rsp_data.send_ussd.text.string,
+ tr->terminal_rsp_data.send_ussd.text.string_length,
+ tr->terminal_rsp_data.send_ussd.text.dcs.raw_dcs, alpha_format);
+ g_variant_iter_free(iter);
+ g_variant_unref(intermediate);
+ switch (alpha_format) {
+ case ALPHABET_FORMAT_SMS_DEFAULT:
+ /* As per the test spec TS 151.010-04 raw dcs for SMS default is 0 */
+ tr->terminal_rsp_data.send_ussd.text.dcs.raw_dcs = ALPHABET_FORMAT_SMS_DEFAULT;
+ if (tr->terminal_rsp_data.send_ussd.text.string_length > 0) {
+ int tmp_len;
+ char tmp_str[SAT_TEXT_STRING_LEN_MAX + 1];
+ char *packed_data;
- default:
- tr->terminal_rsp_data.send_ussd.result_type = RESULT_USSD_RETURN_ERROR;
- tr->terminal_rsp_data.send_ussd.ussd_problem = SATK_USSD_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
- }
+ dbg("UTF 8 to GSM SMS default");
+ tcore_util_convert_utf8_to_gsm((unsigned char*)tmp_str, &tmp_len,
+ (unsigned char*)tr->terminal_rsp_data.send_ussd.text.string,
+ tr->terminal_rsp_data.send_ussd.text.string_length);
+ packed_data = (char*) tcore_util_pack_gsm7bit((const unsigned char *)tmp_str, tmp_len);
+ memset(tr->terminal_rsp_data.send_ussd.text.string, 0x00,
+ sizeof(tr->terminal_rsp_data.send_ussd.text.string));
+ if (packed_data) {
+ memcpy((void*)tr->terminal_rsp_data.send_ussd.text.string, packed_data, strlen(packed_data));
+ tr->terminal_rsp_data.send_ussd.text.string_length = strlen(packed_data);
+ g_free(packed_data);
+ }
+ }
+ dbg("final ussd len:%d", tr->terminal_rsp_data.send_ussd.text.string_length);
+ for (i = 0; i < tr->terminal_rsp_data.send_ussd.text.string_length; i++)
+ dbg("string :%c \n", tr->terminal_rsp_data.send_ussd.text.string[i]);
+ break;
+ case ALPHABET_FORMAT_8BIT_DATA: {
+ gint output_data_len = 0;
+ gchar output_data[SAT_USSD_STRING_LEN_MAX];
+ dbg("UTF 8 to GSM 8 BIT DATA");
+ tcore_util_convert_utf8_to_gsm((unsigned char *)output_data, &output_data_len,
+ (unsigned char *)tr->terminal_rsp_data.send_ussd.text.string,
+ tr->terminal_rsp_data.send_ussd.text.string_length);
+ memset(tr->terminal_rsp_data.send_ussd.text.string, 0x00,
+ sizeof(tr->terminal_rsp_data.send_ussd.text.string));
+ if (output_data_len > 0) {
+ memcpy((void*)tr->terminal_rsp_data.send_ussd.text.string, output_data, output_data_len);
+ tr->terminal_rsp_data.send_ussd.text.string_length = output_data_len;
+ }
+ dbg("final ussd len:%d", tr->terminal_rsp_data.send_ussd.text.string_length);
+ for (i = 0; i < tr->terminal_rsp_data.send_ussd.text.string_length; i++)
+ dbg("string :%c \n", tr->terminal_rsp_data.send_ussd.text.string[i]);
+ }
+ break;
+ case ALPHABET_FORMAT_UCS2: {
+ char *tmp = NULL;
+ int str_len = 0;
+ dbg("UCS2 DATA");
+ tcore_util_convert_utf8_to_ucs2(&tmp,
+ &str_len, (unsigned char*)tr->terminal_rsp_data.send_ussd.text.string,
+ tr->terminal_rsp_data.send_ussd.text.string_length);
+ memset(tr->terminal_rsp_data.send_ussd.text.string, 0x00,
+ sizeof(tr->terminal_rsp_data.send_ussd.text.string));
+ memcpy(tr->terminal_rsp_data.send_ussd.text.string, tmp, str_len);
+ tr->terminal_rsp_data.send_ussd.text.string_length = str_len;
+ dbg("final ussd len:%d", tr->terminal_rsp_data.send_ussd.text.string_length);
+ for (i = 0; i < tr->terminal_rsp_data.send_ussd.text.string_length; i++)
+ dbg("string :%c \n", tr->terminal_rsp_data.send_ussd.text.string[i]);
+ g_free(tmp);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ break;
+
+ case RESULT_SS_RETURN_ERROR:
+ case RESULT_USSD_RETURN_ERROR:
+ tr->terminal_rsp_data.send_ussd.result_type = RESULT_USSD_RETURN_ERROR;
+ if (ss_cause == SATK_USSD_PROBLEM_UNKNOWN_ALPHABET)
+ tr->terminal_rsp_data.send_ussd.ussd_problem = ss_cause;
+ break;
+
+ case RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
+ tr->terminal_rsp_data.send_ussd.result_type = RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND;
+ tr->terminal_rsp_data.send_ussd.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ break;
+
+ case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+ tr->terminal_rsp_data.send_ussd.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+ tr->terminal_rsp_data.send_ussd.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ break;
+
+ default:
+ tr->terminal_rsp_data.send_ussd.result_type = RESULT_USSD_RETURN_ERROR;
+ tr->terminal_rsp_data.send_ussd.ussd_problem = SATK_USSD_PROBLEM_NO_SPECIFIC_CAUSE;
+ break;
+ }
result = TRUE;
rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
+ if (rv != TCORE_RETURN_SUCCESS) {
dbg("fail to send terminal response");
result = FALSE;
}
g_free(tr);
#if defined(TIZEN_PLATFORM_USE_QCOM_QMI)
- if( q_data.cmd_data.send_ussd.alpha_id.alpha_data_len && q_data.cmd_data.send_ussd.alpha_id.is_exist ) {
+ if (q_data.cmd_data.send_ussd.alpha_id.alpha_data_len && q_data.cmd_data.send_ussd.alpha_id.is_exist) {
char *path;
const gchar *cp_name;
TelephonySAT *sat;
TelephonyObjectSkeleton *object;
dbg("AlphaID is present, terminate SAT-UI.");
- //emit session end signal
+ /* emit session end signal */
cp_name = tcore_server_get_cp_name_by_plugin(plg);
if (cp_name == NULL) {
err("CP name is NULL");
return result;
}
- if(!exec_result){
+ if (!exec_result) {
dbg("[SAT] setup call data is null");
return result;
}
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return result;
}
dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
- g_variant_get(exec_result, "(iiii)",&resp, &me_problem, &cc_problem, &call_cause);
+ g_variant_get(exec_result, "(iiii)", &resp, &me_problem, &cc_problem, &call_cause);
tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
if (!tr)
tr->terminal_rsp_data.setup_call.device_id.dest = q_data.cmd_data.setup_call.device_id.src;
switch (resp) {
- case RESULT_SUCCESS:
- tr->terminal_rsp_data.setup_call.result_type = RESULT_SUCCESS;
- if (q_data.cmd_data.setup_call.call_setup_icon_id.is_exist || q_data.cmd_data.setup_call.user_confirm_icon_id.is_exist)
- tr->terminal_rsp_data.setup_call.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
- tr->terminal_rsp_data.setup_call.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- tr->terminal_rsp_data.setup_call.cc_problem_type = CC_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
-
- case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
- tr->terminal_rsp_data.setup_call.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- tr->terminal_rsp_data.setup_call.me_problem_type = me_problem;
- break;
+ case RESULT_SUCCESS:
+ tr->terminal_rsp_data.setup_call.result_type = RESULT_SUCCESS;
+ if (q_data.cmd_data.setup_call.call_setup_icon_id.is_exist || q_data.cmd_data.setup_call.user_confirm_icon_id.is_exist)
+ tr->terminal_rsp_data.setup_call.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+ tr->terminal_rsp_data.setup_call.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ tr->terminal_rsp_data.setup_call.cc_problem_type = CC_PROBLEM_NO_SPECIFIC_CAUSE;
+ break;
- case RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:{
- tr->terminal_rsp_data.setup_call.result_type = RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND;
- switch(call_cause){
- case CALL_ERROR_BUSY:
- tr->terminal_rsp_data.setup_call.network_problem_type = NETWORK_PROBLEM_USER_BUSY;
- break;
- default :
- tr->terminal_rsp_data.setup_call.network_problem_type = NETWORK_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
- }
- }break;
+ case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+ tr->terminal_rsp_data.setup_call.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+ tr->terminal_rsp_data.setup_call.me_problem_type = me_problem;
+ break;
- case RESULT_USER_CLEAR_DOWN_CALL_BEFORE_CONN:
- tr->terminal_rsp_data.setup_call.result_type = RESULT_USER_CLEAR_DOWN_CALL_BEFORE_CONN;
- tr->terminal_rsp_data.setup_call.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- tr->terminal_rsp_data.setup_call.cc_problem_type = CC_PROBLEM_NO_SPECIFIC_CAUSE;
+ case RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND: {
+ tr->terminal_rsp_data.setup_call.result_type = RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND;
+ switch (call_cause) {
+ case CALL_ERROR_BUSY:
+ tr->terminal_rsp_data.setup_call.network_problem_type = NETWORK_PROBLEM_USER_BUSY;
break;
-
- case RESULT_BEYOND_ME_CAPABILITIES:
- tr->terminal_rsp_data.setup_call.result_type = RESULT_BEYOND_ME_CAPABILITIES;
- tr->terminal_rsp_data.setup_call.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- tr->terminal_rsp_data.setup_call.cc_problem_type = CC_PROBLEM_NO_SPECIFIC_CAUSE;
+ default:
+ tr->terminal_rsp_data.setup_call.network_problem_type = NETWORK_PROBLEM_NO_SPECIFIC_CAUSE;
break;
+ }
+ } break;
- case RESULT_INTRCTN_WITH_CC_OR_SMS_CTRL_PRMNT_PRBLM:
- tr->terminal_rsp_data.setup_call.result_type = RESULT_INTRCTN_WITH_CC_OR_SMS_CTRL_PRMNT_PRBLM;
- tr->terminal_rsp_data.setup_call.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- tr->terminal_rsp_data.setup_call.cc_problem_type = cc_problem;
- break;
+ case RESULT_USER_CLEAR_DOWN_CALL_BEFORE_CONN:
+ tr->terminal_rsp_data.setup_call.result_type = RESULT_USER_CLEAR_DOWN_CALL_BEFORE_CONN;
+ tr->terminal_rsp_data.setup_call.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ tr->terminal_rsp_data.setup_call.cc_problem_type = CC_PROBLEM_NO_SPECIFIC_CAUSE;
+ break;
+ case RESULT_BEYOND_ME_CAPABILITIES:
+ tr->terminal_rsp_data.setup_call.result_type = RESULT_BEYOND_ME_CAPABILITIES;
+ tr->terminal_rsp_data.setup_call.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ tr->terminal_rsp_data.setup_call.cc_problem_type = CC_PROBLEM_NO_SPECIFIC_CAUSE;
+ break;
- default:
- break;
+ case RESULT_INTRCTN_WITH_CC_OR_SMS_CTRL_PRMNT_PRBLM:
+ tr->terminal_rsp_data.setup_call.result_type = RESULT_INTRCTN_WITH_CC_OR_SMS_CTRL_PRMNT_PRBLM;
+ tr->terminal_rsp_data.setup_call.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ tr->terminal_rsp_data.setup_call.cc_problem_type = cc_problem;
+ break;
+
+ default:
+ break;
}
- //TODO Other infomation set - not supported
+ /* TODO Other infomation set - not supported */
tr->terminal_rsp_data.setup_call.other_info = FALSE;
result = TRUE;
rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
+ if (rv != TCORE_RETURN_SUCCESS) {
dbg("fail to send terminal response");
result = FALSE;
}
return result;
}
- if(!exec_result){
+ if (!exec_result) {
dbg("[SAT] send ss data is null");
return result;
}
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return result;
}
dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
- g_variant_get(exec_result, "(i)",&resp);
+ g_variant_get(exec_result, "(i)", &resp);
tr.cmd_number = q_data.cmd_data.idle_mode.command_detail.cmd_num;
tr.cmd_type = q_data.cmd_data.idle_mode.command_detail.cmd_type;
tr.terminal_rsp_data.setup_idle_mode_text.device_id.dest = q_data.cmd_data.idle_mode.device_id.src;
switch (resp) {
- case RESULT_SUCCESS:
- tr.terminal_rsp_data.setup_idle_mode_text.result_type = RESULT_SUCCESS;
- if (q_data.cmd_data.idle_mode.icon_id.is_exist)
- tr.terminal_rsp_data.setup_idle_mode_text.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+ case RESULT_SUCCESS:
+ tr.terminal_rsp_data.setup_idle_mode_text.result_type = RESULT_SUCCESS;
+ if (q_data.cmd_data.idle_mode.icon_id.is_exist)
+ tr.terminal_rsp_data.setup_idle_mode_text.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
- break;
- default:
- tr.terminal_rsp_data.setup_idle_mode_text.result_type = resp;
- break;
+ break;
+ default:
+ tr.terminal_rsp_data.setup_idle_mode_text.result_type = resp;
+ break;
}
result = TRUE;
rv = sat_manager_send_terminal_response(ctx->comm, plg, &tr);
- if(rv != TCORE_RETURN_SUCCESS){
+ if (rv != TCORE_RETURN_SUCCESS) {
dbg("fail to send terminal response");
result = FALSE;
}
return result;
}
- if(!exec_result){
+ if (!exec_result) {
dbg("[SAT] open channel data is null");
return result;
}
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return result;
}
dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
- g_variant_get(exec_result, "(iiiiiiiibv)",&resp, &me_problem, &bip_problem,
+ g_variant_get(exec_result, "(iiiiiiiibv)", &resp, &me_problem, &bip_problem,
&bearer_type, &channel_id, &channel_status, &channel_status_info, &buffer_size,
&other_info, &desc_tmp);
tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
if (!tr)
return result;
+
tr->cmd_number = q_data.cmd_data.open_channel.command_detail.cmd_num;
tr->cmd_type = q_data.cmd_data.open_channel.command_detail.cmd_type;
memcpy((void*)&tr->terminal_rsp_data.open_channel.command_detail, &q_data.cmd_data.open_channel.command_detail, sizeof(struct tel_sat_cmd_detail_info));
tr->terminal_rsp_data.open_channel.result_type = resp;
switch (resp) {
- case RESULT_SUCCESS:
- case RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED:
- case RESULT_SUCCESS_WITH_MISSING_INFO:
- //channel status
- break;
+ case RESULT_SUCCESS:
+ case RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED:
+ case RESULT_SUCCESS_WITH_MISSING_INFO:
+ /* channel status */
+ break;
- case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
- case RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
- tr->terminal_rsp_data.open_channel.me_problem_type = me_problem;
- break;
+ case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+ case RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
+ tr->terminal_rsp_data.open_channel.me_problem_type = me_problem;
+ break;
- case RESULT_BEARER_INDEPENDENT_PROTOCOL_ERROR:
- tr->terminal_rsp_data.open_channel.bip_problem_type = bip_problem;
- break;
+ case RESULT_BEARER_INDEPENDENT_PROTOCOL_ERROR:
+ tr->terminal_rsp_data.open_channel.bip_problem_type = bip_problem;
+ break;
- default:
- break;
+ default:
+ break;
}
tr->terminal_rsp_data.open_channel.channel_status.channel_id = channel_id;
dbg("check channel id(%d) channel status(%d) channel info(%d)", channel_id, channel_status, channel_status_info);
- //memcpy(tr->terminal_rsp_data.open_channel.buffer_size.size, &buffer_size, sizeof(unsigned char)*2);
+ /* memcpy(tr->terminal_rsp_data.open_channel.buffer_size.size, &buffer_size, sizeof(unsigned char)*2); */
tr->terminal_rsp_data.open_channel.buffer_size.size[0] = buffer_size >> 8;
tr->terminal_rsp_data.open_channel.buffer_size.size[1] = buffer_size & 0xFF;
dbg("check buffer size[0](0x%x) size[1](0x%x)", tr->terminal_rsp_data.open_channel.buffer_size.size[0], tr->terminal_rsp_data.open_channel.buffer_size.size[1]);
tr->terminal_rsp_data.open_channel.bearer_desc.bearer_type = bearer_type;
- switch(bearer_type){
- case BEARER_CSD:{
- gint data_rate, service_type, conn_element_type;
-
- dbg("bearer_desc cs bearer type_format(%s)", g_variant_get_type_string(bearer_desc));
- g_variant_get(bearer_desc, "(iii)",&data_rate, &service_type, &conn_element_type);
- dbg("check cs bearer data_rade(%d), service_type(%d), conn_element_type(%d)", data_rate, service_type, conn_element_type);
-
- tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.cs_bearer_param.data_rate = data_rate;
- tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.cs_bearer_param.service_type = service_type;
- tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.cs_bearer_param.connection_element_type = conn_element_type;
- }break;
- case BEARER_GPRS:{
- gint precedence_class, delay_class, reliability_class;
- gint peak_class, mean_class, pdp_type;
-
- dbg("bearer_desc ps bearer type_format(%s)", g_variant_get_type_string(bearer_desc));
- g_variant_get(bearer_desc, "(iiiiii)",&precedence_class, &delay_class, &reliability_class,
- &peak_class, &mean_class, &pdp_type);
- dbg("check ps bearer precedence class(%d), delay class(%d), reliability class(%d) peak class(%d) mean class(%d) pdp_type(%d)",
- precedence_class, delay_class, reliability_class, peak_class, mean_class, pdp_type);
-
- tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.ps_bearer_param.precedence_class = precedence_class;
- tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.ps_bearer_param.delay_class = delay_class;
- tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.ps_bearer_param.reliability_class = reliability_class;
- tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.ps_bearer_param.peak_throughput_class = peak_class;
- tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.ps_bearer_param.mean_throughput_class = mean_class;
- tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.ps_bearer_param.pdp_type = pdp_type;
- }break;
- case BEARER_LOCAL_LINK_TECHNOLOGY_INDEPENDENT:{
- gint service_type;
- gchar *service_record = NULL;
-
- dbg("bearer_desc link local type_format(%s)", g_variant_get_type_string(bearer_desc));
- g_variant_get(bearer_desc, "(is)",&service_type, &service_record);
- dbg("check link local service_type(%d), service_record(%d)", service_type, service_record);
-
- tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.local_link_bearer_param.service_type = service_type;
-
- if(service_record) {
- memcpy(tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.local_link_bearer_param.service_record, service_record, strlen(service_record));
- g_free(service_record);
- }
+ switch (bearer_type) {
+ case BEARER_CSD: {
+ gint data_rate, service_type, conn_element_type;
+
+ dbg("bearer_desc cs bearer type_format(%s)", g_variant_get_type_string(bearer_desc));
+ g_variant_get(bearer_desc, "(iii)", &data_rate, &service_type, &conn_element_type);
+ dbg("check cs bearer data_rade(%d), service_type(%d), conn_element_type(%d)", data_rate, service_type, conn_element_type);
+
+ tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.cs_bearer_param.data_rate = data_rate;
+ tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.cs_bearer_param.service_type = service_type;
+ tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.cs_bearer_param.connection_element_type = conn_element_type;
+ } break;
+ case BEARER_GPRS: {
+ gint precedence_class, delay_class, reliability_class;
+ gint peak_class, mean_class, pdp_type;
+
+ dbg("bearer_desc ps bearer type_format(%s)", g_variant_get_type_string(bearer_desc));
+ g_variant_get(bearer_desc, "(iiiiii)", &precedence_class, &delay_class, &reliability_class,
+ &peak_class, &mean_class, &pdp_type);
+ dbg("check ps bearer precedence class(%d), delay class(%d), reliability class(%d) peak class(%d) mean class(%d) pdp_type(%d)",
+ precedence_class, delay_class, reliability_class, peak_class, mean_class, pdp_type);
+
+ tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.ps_bearer_param.precedence_class = precedence_class;
+ tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.ps_bearer_param.delay_class = delay_class;
+ tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.ps_bearer_param.reliability_class = reliability_class;
+ tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.ps_bearer_param.peak_throughput_class = peak_class;
+ tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.ps_bearer_param.mean_throughput_class = mean_class;
+ tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.ps_bearer_param.pdp_type = pdp_type;
+ } break;
+ case BEARER_LOCAL_LINK_TECHNOLOGY_INDEPENDENT: {
+ gint service_type;
+ gchar *service_record = NULL;
- }break;
- default:
- break;
+ dbg("bearer_desc link local type_format(%s)", g_variant_get_type_string(bearer_desc));
+ g_variant_get(bearer_desc, "(is)", &service_type, &service_record);
+ dbg("check link local service_type(%d), service_record(%d)", service_type, service_record);
+
+ tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.local_link_bearer_param.service_type = service_type;
+
+ if (service_record) {
+ memcpy(tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.local_link_bearer_param.service_record, service_record, strlen(service_record));
+ g_free(service_record);
+ }
+ } break;
+ default:
+ break;
}
result = TRUE;
rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
+ if (rv != TCORE_RETURN_SUCCESS) {
dbg("fail to send terminal response");
result = FALSE;
}
return result;
}
- if(!exec_result){
+ if (!exec_result) {
dbg("[SAT] close channel data is null");
return result;
}
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return result;
}
dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
- g_variant_get(exec_result, "(iii)",&resp, &me_problem, &bip_problem);
+ g_variant_get(exec_result, "(iii)", &resp, &me_problem, &bip_problem);
tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
if (!tr)
return result;
+
tr->cmd_number = q_data.cmd_data.close_channel.command_detail.cmd_num;
tr->cmd_type = q_data.cmd_data.close_channel.command_detail.cmd_type;
memcpy((void*)&tr->terminal_rsp_data.close_channel.command_detail, &q_data.cmd_data.close_channel.command_detail, sizeof(struct tel_sat_cmd_detail_info));
tr->terminal_rsp_data.close_channel.result_type = resp;
switch (resp) {
- case RESULT_SUCCESS:
- case RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED:
- case RESULT_SUCCESS_WITH_MISSING_INFO:
- //channel status
- break;
+ case RESULT_SUCCESS:
+ case RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED:
+ case RESULT_SUCCESS_WITH_MISSING_INFO:
+ /* channel status */
+ break;
- case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
- case RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
- tr->terminal_rsp_data.close_channel.me_problem_type = me_problem;
- break;
+ case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+ case RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
+ tr->terminal_rsp_data.close_channel.me_problem_type = me_problem;
+ break;
- case RESULT_BEARER_INDEPENDENT_PROTOCOL_ERROR:
- tr->terminal_rsp_data.close_channel.bip_problem_type = bip_problem;
- break;
+ case RESULT_BEARER_INDEPENDENT_PROTOCOL_ERROR:
+ tr->terminal_rsp_data.close_channel.bip_problem_type = bip_problem;
+ break;
- default:
- break;
+ default:
+ break;
}
result = TRUE;
rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
+ if (rv != TCORE_RETURN_SUCCESS) {
dbg("fail to send terminal response");
result = FALSE;
}
return result;
}
- if(!exec_result){
+ if (!exec_result) {
dbg("[SAT] receive data data is null");
return result;
}
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return result;
}
dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
- g_variant_get(exec_result, "(iiiiibv)",&resp, &me_problem, &bip_problem, &data_str_len, &data_len, &other_info, &received_data);
+ g_variant_get(exec_result, "(iiiiibv)", &resp, &me_problem, &bip_problem, &data_str_len, &data_len, &other_info, &received_data);
tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
if (!tr)
return result;
+
tr->cmd_number = q_data.cmd_data.receive_data.command_detail.cmd_num;
tr->cmd_type = q_data.cmd_data.receive_data.command_detail.cmd_type;
memcpy((void*)&tr->terminal_rsp_data.receive_data.command_detail, &q_data.cmd_data.receive_data.command_detail, sizeof(struct tel_sat_cmd_detail_info));
tr->terminal_rsp_data.receive_data.result_type = resp;
switch (resp) {
- case RESULT_SUCCESS:
- case RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED:
- case RESULT_SUCCESS_WITH_MISSING_INFO:
- //channel status
- break;
+ case RESULT_SUCCESS:
+ case RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED:
+ case RESULT_SUCCESS_WITH_MISSING_INFO:
+ /* channel status */
+ break;
- case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
- case RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
- tr->terminal_rsp_data.receive_data.me_problem_type = me_problem;
- break;
+ case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+ case RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
+ tr->terminal_rsp_data.receive_data.me_problem_type = me_problem;
+ break;
- case RESULT_BEARER_INDEPENDENT_PROTOCOL_ERROR:
- tr->terminal_rsp_data.receive_data.bip_problem_type = bip_problem;
- break;
+ case RESULT_BEARER_INDEPENDENT_PROTOCOL_ERROR:
+ tr->terminal_rsp_data.receive_data.bip_problem_type = bip_problem;
+ break;
- default:
- break;
+ default:
+ break;
}
tr->terminal_rsp_data.receive_data.channel_data_len.data_len = data_len;
tr->terminal_rsp_data.receive_data.channel_data.data_string_len = data_str_len;
- if(received_data){
+ if (received_data) {
int local_index = 0;
guchar data;
GVariantIter *iter = NULL;
dbg("additional data exist type_format(%s)", g_variant_get_type_string(received_data));
g_variant_get(received_data, "ay", &iter);
- while( g_variant_iter_loop (iter, "y", &data)){
- //dbg("index(%d) data(%d)", index, data);
+ while (g_variant_iter_loop(iter, "y", &data)) {
tr->terminal_rsp_data.receive_data.channel_data.data_string[local_index] = data;
local_index++;
}
result = TRUE;
rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
+ if (rv != TCORE_RETURN_SUCCESS) {
dbg("fail to send terminal response");
result = FALSE;
}
return result;
}
- if(!exec_result){
+ if (!exec_result) {
dbg("[SAT] send data data is null");
return result;
}
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return result;
}
dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
- g_variant_get(exec_result, "(iiii)",&resp, &me_problem, &bip_problem, &data_len);
+ g_variant_get(exec_result, "(iiii)", &resp, &me_problem, &bip_problem, &data_len);
tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
if (!tr)
return result;
+
tr->cmd_number = q_data.cmd_data.send_data.command_detail.cmd_num;
tr->cmd_type = q_data.cmd_data.send_data.command_detail.cmd_type;
memcpy((void*)&tr->terminal_rsp_data.send_data.command_detail, &q_data.cmd_data.send_data.command_detail, sizeof(struct tel_sat_cmd_detail_info));
tr->terminal_rsp_data.send_data.result_type = resp;
switch (resp) {
- case RESULT_SUCCESS:
- case RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED:
- case RESULT_SUCCESS_WITH_MISSING_INFO:
- //channel status
- break;
+ case RESULT_SUCCESS:
+ case RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED:
+ case RESULT_SUCCESS_WITH_MISSING_INFO:
+ /* channel status */
+ break;
- case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
- case RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
- tr->terminal_rsp_data.send_data.me_problem_type = me_problem;
- break;
+ case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+ case RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
+ tr->terminal_rsp_data.send_data.me_problem_type = me_problem;
+ break;
- case RESULT_BEARER_INDEPENDENT_PROTOCOL_ERROR:
- tr->terminal_rsp_data.send_data.bip_problem_type = bip_problem;
- break;
+ case RESULT_BEARER_INDEPENDENT_PROTOCOL_ERROR:
+ tr->terminal_rsp_data.send_data.bip_problem_type = bip_problem;
+ break;
- default:
- break;
+ default:
+ break;
}
tr->terminal_rsp_data.send_data.channel_data_len.data_len = data_len;
result = TRUE;
rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
+ if (rv != TCORE_RETURN_SUCCESS) {
dbg("fail to send terminal response");
result = FALSE;
}
return result;
}
- if(!exec_result){
+ if (!exec_result) {
dbg("[SAT] get channel status data is null");
return result;
}
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return result;
}
dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
- g_variant_get(exec_result, "(iiiiii)",&resp, &me_problem, &bip_problem,
- &channel_id, &channel_status, &channel_status_info);
+ g_variant_get(exec_result, "(iiiiii)", &resp, &me_problem, &bip_problem,
+ &channel_id, &channel_status, &channel_status_info);
tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
if (!tr)
return result;
+
tr->cmd_number = q_data.cmd_data.get_channel_status.command_detail.cmd_num;
tr->cmd_type = q_data.cmd_data.get_channel_status.command_detail.cmd_type;
memcpy((void*)&tr->terminal_rsp_data.get_channel_status.command_detail, &q_data.cmd_data.get_channel_status.command_detail, sizeof(struct tel_sat_cmd_detail_info));
tr->terminal_rsp_data.get_channel_status.result_type = resp;
switch (resp) {
- case RESULT_SUCCESS:
- case RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED:
- case RESULT_SUCCESS_WITH_MISSING_INFO:
- //channel status
- break;
+ case RESULT_SUCCESS:
+ case RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED:
+ case RESULT_SUCCESS_WITH_MISSING_INFO:
+ /* channel status */
+ break;
- case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
- case RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
- tr->terminal_rsp_data.get_channel_status.me_problem_type = me_problem;
- break;
+ case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+ case RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
+ tr->terminal_rsp_data.get_channel_status.me_problem_type = me_problem;
+ break;
- case RESULT_BEARER_INDEPENDENT_PROTOCOL_ERROR:
- tr->terminal_rsp_data.get_channel_status.bip_problem_type = bip_problem;
- break;
+ case RESULT_BEARER_INDEPENDENT_PROTOCOL_ERROR:
+ tr->terminal_rsp_data.get_channel_status.bip_problem_type = bip_problem;
+ break;
- default:
- break;
+ default:
+ break;
}
tr->terminal_rsp_data.get_channel_status.channel_status.channel_id = channel_id;
result = TRUE;
rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
+ if (rv != TCORE_RETURN_SUCCESS) {
dbg("fail to send terminal response");
result = FALSE;
}
tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
if (!tr)
return result;
+
memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
return result;
}
- if(!exec_result){
+ if (!exec_result) {
dbg("[SAT] get channel status data is null");
g_free(tr);
return result;
}
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
g_free(tr);
return result;
}
dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
- g_variant_get(exec_result, "(i)",&resp);
+ g_variant_get(exec_result, "(i)", &resp);
tr->cmd_number = q_data.cmd_data.send_dtmf.command_detail.cmd_num;
tr->cmd_type = q_data.cmd_data.send_dtmf.command_detail.cmd_type;
tr->terminal_rsp_data.send_dtmf.result_type = resp;
switch (resp) {
- case RESULT_SUCCESS:
- if (q_data.cmd_data.send_dtmf.icon_id.is_exist)
- tr->terminal_rsp_data.send_dtmf.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
- break;
+ case RESULT_SUCCESS:
+ if (q_data.cmd_data.send_dtmf.icon_id.is_exist)
+ tr->terminal_rsp_data.send_dtmf.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+ break;
- case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
- tr->terminal_rsp_data.send_dtmf.me_problem_type = ME_PROBLEM_NOT_IN_SPEECH_CALL;
- break;
+ case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+ tr->terminal_rsp_data.send_dtmf.me_problem_type = ME_PROBLEM_NOT_IN_SPEECH_CALL;
+ break;
- default:
- tr->terminal_rsp_data.send_dtmf.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- tr->terminal_rsp_data.send_dtmf.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
+ default:
+ tr->terminal_rsp_data.send_dtmf.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+ tr->terminal_rsp_data.send_dtmf.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ break;
}
result = TRUE;
rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
+ if (rv != TCORE_RETURN_SUCCESS) {
dbg("fail to send terminal response");
result = FALSE;
}
return result;
}
- if(!exec_result){
+ if (!exec_result) {
dbg("[SAT] get channel status data is null");
return result;
}
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return result;
}
dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
- g_variant_get(exec_result, "(ii)",&resp,&browser_problem);
+ g_variant_get(exec_result, "(ii)", &resp, &browser_problem);
tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
if (!tr)
return result;
+
tr->cmd_number = q_data.cmd_data.launch_browser.command_detail.cmd_num;
tr->cmd_type = q_data.cmd_data.launch_browser.command_detail.cmd_type;
memcpy((void*)&tr->terminal_rsp_data.launch_browser.command_detail, &q_data.cmd_data.launch_browser.command_detail, sizeof(struct tel_sat_cmd_detail_info));
tr->terminal_rsp_data.launch_browser.result_type = resp;
switch (resp) {
- case RESULT_SUCCESS:
- if (q_data.cmd_data.launch_browser.user_confirm_icon_id.is_exist)
- tr->terminal_rsp_data.launch_browser.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+ case RESULT_SUCCESS:
+ if (q_data.cmd_data.launch_browser.user_confirm_icon_id.is_exist)
+ tr->terminal_rsp_data.launch_browser.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
- tr->terminal_rsp_data.launch_browser.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- tr->terminal_rsp_data.launch_browser.browser_problem_type = BROWSER_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
- case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
- tr->terminal_rsp_data.launch_browser.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- tr->terminal_rsp_data.launch_browser.browser_problem_type = BROWSER_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
+ tr->terminal_rsp_data.launch_browser.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ tr->terminal_rsp_data.launch_browser.browser_problem_type = BROWSER_PROBLEM_NO_SPECIFIC_CAUSE;
+ break;
- case RESULT_LAUNCH_BROWSER_GENERIC_ERROR_CODE:
- tr->terminal_rsp_data.launch_browser.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- tr->terminal_rsp_data.launch_browser.browser_problem_type = browser_problem;
- break;
- default:
- tr->terminal_rsp_data.launch_browser.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- tr->terminal_rsp_data.launch_browser.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- tr->terminal_rsp_data.launch_browser.browser_problem_type = BROWSER_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
+ case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
+ tr->terminal_rsp_data.launch_browser.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ tr->terminal_rsp_data.launch_browser.browser_problem_type = BROWSER_PROBLEM_NO_SPECIFIC_CAUSE;
+ break;
+
+ case RESULT_LAUNCH_BROWSER_GENERIC_ERROR_CODE:
+ tr->terminal_rsp_data.launch_browser.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ tr->terminal_rsp_data.launch_browser.browser_problem_type = browser_problem;
+ break;
+
+ default:
+ tr->terminal_rsp_data.launch_browser.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
+ tr->terminal_rsp_data.launch_browser.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ tr->terminal_rsp_data.launch_browser.browser_problem_type = BROWSER_PROBLEM_NO_SPECIFIC_CAUSE;
+ break;
}
result = TRUE;
rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
+ if (rv != TCORE_RETURN_SUCCESS) {
dbg("fail to send terminal response");
result = FALSE;
}
g_variant_get(exec_result, "v", &resp);
switch (command_type) {
- case SAT_PROATV_CMD_SETUP_MENU:
- result = _sat_manager_handle_setup_menu_result(ctx, plg, command_id, resp);
- break;
+ case SAT_PROATV_CMD_SETUP_MENU:
+ result = _sat_manager_handle_setup_menu_result(ctx, plg, command_id, resp);
+ break;
- case SAT_PROATV_CMD_DISPLAY_TEXT:
- result = _sat_manager_handle_display_text_result(ctx, plg, command_id, resp);
- break;
+ case SAT_PROATV_CMD_DISPLAY_TEXT:
+ result = _sat_manager_handle_display_text_result(ctx, plg, command_id, resp);
+ break;
- case SAT_PROATV_CMD_PLAY_TONE:
- result = _sat_manager_handle_play_tone_result(ctx, plg, command_id, resp);
- break;
+ case SAT_PROATV_CMD_PLAY_TONE:
+ result = _sat_manager_handle_play_tone_result(ctx, plg, command_id, resp);
+ break;
- case SAT_PROATV_CMD_SEND_SMS:
- result = _sat_manager_handle_send_sms_result(ctx, plg, command_id, resp);
- break;
+ case SAT_PROATV_CMD_SEND_SMS:
+ result = _sat_manager_handle_send_sms_result(ctx, plg, command_id, resp);
+ break;
- case SAT_PROATV_CMD_SEND_SS:
- result = _sat_manager_handle_send_ss_result(ctx, plg, command_id, resp);
- break;
+ case SAT_PROATV_CMD_SEND_SS:
+ result = _sat_manager_handle_send_ss_result(ctx, plg, command_id, resp);
+ break;
- case SAT_PROATV_CMD_SEND_USSD:
- result = _sat_manager_handle_send_ussd_result(ctx, plg, command_id, resp);
- break;
+ case SAT_PROATV_CMD_SEND_USSD:
+ result = _sat_manager_handle_send_ussd_result(ctx, plg, command_id, resp);
+ break;
- case SAT_PROATV_CMD_SETUP_CALL:
- result = _sat_manager_handle_setup_call_result(ctx, plg, command_id, resp);
- break;
+ case SAT_PROATV_CMD_SETUP_CALL:
+ result = _sat_manager_handle_setup_call_result(ctx, plg, command_id, resp);
+ break;
- case SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT:
- result = _sat_manager_handle_setup_idle_mode_text_result(ctx, plg, command_id, resp);
- break;
+ case SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT:
+ result = _sat_manager_handle_setup_idle_mode_text_result(ctx, plg, command_id, resp);
+ break;
- case SAT_PROATV_CMD_OPEN_CHANNEL:
- result = sat_manager_handle_open_channel_result(ctx, plg, command_id, resp);
- break;
+ case SAT_PROATV_CMD_OPEN_CHANNEL:
+ result = sat_manager_handle_open_channel_result(ctx, plg, command_id, resp);
+ break;
- case SAT_PROATV_CMD_CLOSE_CHANNEL:
- result = sat_manager_handle_close_channel_result(ctx, plg, command_id, resp);
- break;
+ case SAT_PROATV_CMD_CLOSE_CHANNEL:
+ result = sat_manager_handle_close_channel_result(ctx, plg, command_id, resp);
+ break;
- case SAT_PROATV_CMD_RECEIVE_DATA:
- result = sat_manager_handle_receive_data_result(ctx, plg, command_id, resp);
- break;
+ case SAT_PROATV_CMD_RECEIVE_DATA:
+ result = sat_manager_handle_receive_data_result(ctx, plg, command_id, resp);
+ break;
- case SAT_PROATV_CMD_SEND_DATA:
- result = sat_manager_handle_send_data_result(ctx, plg, command_id, resp);
- break;
+ case SAT_PROATV_CMD_SEND_DATA:
+ result = sat_manager_handle_send_data_result(ctx, plg, command_id, resp);
+ break;
- case SAT_PROATV_CMD_GET_CHANNEL_STATUS:
- result = sat_manager_handle_get_channel_status_result(ctx, plg, command_id, resp);
- break;
+ case SAT_PROATV_CMD_GET_CHANNEL_STATUS:
+ result = sat_manager_handle_get_channel_status_result(ctx, plg, command_id, resp);
+ break;
- case SAT_PROATV_CMD_SEND_DTMF:
- result = sat_manager_handle_send_dtmf_result(ctx, plg, command_id, resp);
- break;
+ case SAT_PROATV_CMD_SEND_DTMF:
+ result = sat_manager_handle_send_dtmf_result(ctx, plg, command_id, resp);
+ break;
- case SAT_PROATV_CMD_LAUNCH_BROWSER:
- result = sat_manager_handle_launch_browser_result(ctx, plg, command_id, resp);
- break;
+ case SAT_PROATV_CMD_LAUNCH_BROWSER:
+ result = sat_manager_handle_launch_browser_result(ctx, plg, command_id, resp);
+ break;
- default:
- dbg("[SAT] invalid command type(%d)", command_type);
- break;
+ default:
+ dbg("[SAT] invalid command type(%d)", command_type);
+ break;
}
return result;
TReturn rv = TCORE_RETURN_FAILURE;
gboolean result = FALSE;
- gint item_id=0;
+ gint item_id = 0;
struct treq_sat_terminal_rsp_data *tr;
struct sat_manager_queue_data q_data;
return result;
}
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return result;
}
- if(addtional_data){
+ if (addtional_data) {
int local_index = 0;
guchar data;
GVariantIter *iter = NULL;
dbg("additional data exist type_format(%s)", g_variant_get_type_string(inner_gv));
g_variant_get(inner_gv, "ay", &iter);
- while( g_variant_iter_loop (iter, "y", &data)){
+ while (g_variant_iter_loop(iter, "y", &data)) {
dbg("index(%d) data(%d)", local_index, data);
item_id = data;
local_index++;
tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
if (!tr)
return result;
+
tr->cmd_number = q_data.cmd_data.selectItemInd.command_detail.cmd_num;
tr->cmd_type = q_data.cmd_data.selectItemInd.command_detail.cmd_type;
memcpy((void*)&tr->terminal_rsp_data.select_item.command_detail, &q_data.cmd_data.selectItemInd.command_detail, sizeof(struct tel_sat_cmd_detail_info));
tr->terminal_rsp_data.select_item.device_id.dest = DEVICE_ID_SIM;
switch (confirm_type) {
- case USER_CONFIRM_YES:
- tr->terminal_rsp_data.select_item.item_identifier.item_identifier = item_id;
- tr->terminal_rsp_data.select_item.other_info = FALSE;
- tr->terminal_rsp_data.select_item.result_type = RESULT_SUCCESS;
- tr->terminal_rsp_data.select_item.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ case USER_CONFIRM_YES:
+ tr->terminal_rsp_data.select_item.item_identifier.item_identifier = item_id;
+ tr->terminal_rsp_data.select_item.other_info = FALSE;
+ tr->terminal_rsp_data.select_item.result_type = RESULT_SUCCESS;
+ tr->terminal_rsp_data.select_item.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- if(q_data.cmd_data.selectItemInd.text_attribute.b_txt_attr || q_data.cmd_data.selectItemInd.text_attribute_list.list_cnt > 0)
- tr->terminal_rsp_data.select_item.result_type = RESULT_SUCCESS_WITH_PARTIAL_COMPREHENSION;
+ if (q_data.cmd_data.selectItemInd.text_attribute.b_txt_attr || q_data.cmd_data.selectItemInd.text_attribute_list.list_cnt > 0)
+ tr->terminal_rsp_data.select_item.result_type = RESULT_SUCCESS_WITH_PARTIAL_COMPREHENSION;
- if (q_data.cmd_data.selectItemInd.icon_id.is_exist)
- tr->terminal_rsp_data.select_item.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+ if (q_data.cmd_data.selectItemInd.icon_id.is_exist)
+ tr->terminal_rsp_data.select_item.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
- break;
+ break;
- case USER_CONFIRM_HELP_INFO:
- tr->terminal_rsp_data.select_item.item_identifier.item_identifier = item_id;
- tr->terminal_rsp_data.select_item.other_info = FALSE;
- tr->terminal_rsp_data.select_item.result_type = RESULT_HELP_INFO_REQUIRED_BY_USER;
- tr->terminal_rsp_data.select_item.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- //TODO ctx->help_requested = TRUE;
- break;
+ case USER_CONFIRM_HELP_INFO:
+ tr->terminal_rsp_data.select_item.item_identifier.item_identifier = item_id;
+ tr->terminal_rsp_data.select_item.other_info = FALSE;
+ tr->terminal_rsp_data.select_item.result_type = RESULT_HELP_INFO_REQUIRED_BY_USER;
+ tr->terminal_rsp_data.select_item.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ /* TODO ctx->help_requested = TRUE; */
+ break;
- case USER_CONFIRM_END:
- tr->terminal_rsp_data.select_item.result_type = RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
- break;
+ case USER_CONFIRM_END:
+ tr->terminal_rsp_data.select_item.result_type = RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
+ break;
- case USER_CONFIRM_NO_OR_CANCEL:
- tr->terminal_rsp_data.select_item.result_type = RESULT_BACKWARD_MOVE_BY_USER;
- break;
+ case USER_CONFIRM_NO_OR_CANCEL:
+ tr->terminal_rsp_data.select_item.result_type = RESULT_BACKWARD_MOVE_BY_USER;
+ break;
- case USER_CONFIRM_TIMEOUT:
- tr->terminal_rsp_data.select_item.result_type = RESULT_NO_RESPONSE_FROM_USER;
- break;
+ case USER_CONFIRM_TIMEOUT:
+ tr->terminal_rsp_data.select_item.result_type = RESULT_NO_RESPONSE_FROM_USER;
+ break;
- default:
- dbg("not handled value[%d] here", confirm_type);
- break;
+ default:
+ dbg("not handled value[%d] here", confirm_type);
+ break;
}
result = TRUE;
rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
+ if (rv != TCORE_RETURN_SUCCESS) {
dbg("fail to send terminal response");
result = FALSE;
}
return result;
}
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return result;
}
tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
if (!tr)
return result;
+
tr->cmd_number = q_data.cmd_data.displayTextInd.command_detail.cmd_num;
tr->cmd_type = q_data.cmd_data.displayTextInd.command_detail.cmd_type;
memcpy((void*)&tr->terminal_rsp_data.display_text.command_detail, &q_data.cmd_data.displayTextInd.command_detail, sizeof(struct tel_sat_cmd_detail_info));
tr->terminal_rsp_data.display_text.device_id.src = DEVICE_ID_ME;
tr->terminal_rsp_data.display_text.device_id.dest = DEVICE_ID_SIM;
- switch (confirm_type){
- case USER_CONFIRM_YES: {
- tr->terminal_rsp_data.display_text.result_type = RESULT_SUCCESS;
- tr->terminal_rsp_data.display_text.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
-
- if(q_data.cmd_data.displayTextInd.text_attribute.b_txt_attr)
- tr->terminal_rsp_data.display_text.result_type = RESULT_SUCCESS_WITH_PARTIAL_COMPREHENSION;
+ switch (confirm_type) {
+ case USER_CONFIRM_YES: {
+ tr->terminal_rsp_data.display_text.result_type = RESULT_SUCCESS;
+ tr->terminal_rsp_data.display_text.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- if (q_data.cmd_data.displayTextInd.icon_id.is_exist)
- tr->terminal_rsp_data.display_text.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
- } break;
+ if (q_data.cmd_data.displayTextInd.text_attribute.b_txt_attr)
+ tr->terminal_rsp_data.display_text.result_type = RESULT_SUCCESS_WITH_PARTIAL_COMPREHENSION;
- case USER_CONFIRM_NO_OR_CANCEL:
- tr->terminal_rsp_data.display_text.result_type = RESULT_BACKWARD_MOVE_BY_USER;
- break;
+ if (q_data.cmd_data.displayTextInd.icon_id.is_exist)
+ tr->terminal_rsp_data.display_text.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+ } break;
- case USER_CONFIRM_TIMEOUT:
- tr->terminal_rsp_data.display_text.result_type = RESULT_SUCCESS;
+ case USER_CONFIRM_NO_OR_CANCEL:
+ tr->terminal_rsp_data.display_text.result_type = RESULT_BACKWARD_MOVE_BY_USER;
+ break;
- if (q_data.cmd_data.displayTextInd.command_detail.cmd_qualifier.display_text.text_clear_type == TEXT_WAIT_FOR_USER_TO_CLEAR_MSG )
- tr->terminal_rsp_data.display_text.result_type = RESULT_NO_RESPONSE_FROM_USER;
+ case USER_CONFIRM_TIMEOUT:
+ tr->terminal_rsp_data.display_text.result_type = RESULT_SUCCESS;
- break;
+ if (q_data.cmd_data.displayTextInd.command_detail.cmd_qualifier.display_text.text_clear_type == TEXT_WAIT_FOR_USER_TO_CLEAR_MSG)
+ tr->terminal_rsp_data.display_text.result_type = RESULT_NO_RESPONSE_FROM_USER;
+ break;
- case USER_CONFIRM_END:
- tr->terminal_rsp_data.display_text.result_type = RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
- break;
+ case USER_CONFIRM_END:
+ tr->terminal_rsp_data.display_text.result_type = RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
+ break;
- case USER_CONFIRM_HELP_INFO:
- default:
- dbg("not handled value[%d] here", confirm_type);
- break;
+ case USER_CONFIRM_HELP_INFO:
+ default:
+ dbg("not handled value[%d] here", confirm_type);
+ break;
}
result = TRUE;
rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
+ if (rv != TCORE_RETURN_SUCCESS) {
dbg("fail to send terminal response");
result = FALSE;
}
return result;
}
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return result;
}
- if(addtional_data){
+ if (addtional_data) {
int local_index = 0;
guchar data;
GVariantIter *iter = NULL;
dbg("additional data exist type_format(%s)", g_variant_get_type_string(inner_gv));
g_variant_get(inner_gv, "ay", &iter);
- while( g_variant_iter_loop (iter, "y", &data)){
+ while (g_variant_iter_loop(iter, "y", &data)) {
dbg("index(%d) data(%d)", local_index, data);
inkey_data[local_index] = data;
local_index++;
tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
if (!tr)
return result;
+
tr->cmd_number = q_data.cmd_data.getInkeyInd.command_detail.cmd_num;
tr->cmd_type = q_data.cmd_data.getInkeyInd.command_detail.cmd_type;
memcpy((void*)&tr->terminal_rsp_data.get_inkey.command_detail, &q_data.cmd_data.getInkeyInd.command_detail, sizeof(struct tel_sat_cmd_detail_info));
tr->terminal_rsp_data.get_inkey.device_id.src = DEVICE_ID_ME;
tr->terminal_rsp_data.get_inkey.device_id.dest = DEVICE_ID_SIM;
- switch (confirm_type){
- case USER_CONFIRM_YES:
- tr->terminal_rsp_data.get_inkey.result_type = RESULT_SUCCESS;
+ switch (confirm_type) {
+ case USER_CONFIRM_YES:
+ tr->terminal_rsp_data.get_inkey.result_type = RESULT_SUCCESS;
- if(q_data.cmd_data.getInkeyInd.text_attribute.b_txt_attr)
- tr->terminal_rsp_data.get_inkey.result_type = RESULT_SUCCESS_WITH_PARTIAL_COMPREHENSION;
+ if (q_data.cmd_data.getInkeyInd.text_attribute.b_txt_attr)
+ tr->terminal_rsp_data.get_inkey.result_type = RESULT_SUCCESS_WITH_PARTIAL_COMPREHENSION;
- if (q_data.cmd_data.getInkeyInd.icon_id.is_exist)
- tr->terminal_rsp_data.get_inkey.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
+ if (q_data.cmd_data.getInkeyInd.icon_id.is_exist)
+ tr->terminal_rsp_data.get_inkey.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
- if (q_data.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_inkey.inkey_type == INKEY_TYPE_YES_NO_REQUESTED) {
- tr->terminal_rsp_data.get_inkey.text.dcs.m_class = MSG_CLASS_RESERVED;
+ if (q_data.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_inkey.inkey_type == INKEY_TYPE_YES_NO_REQUESTED) {
+ tr->terminal_rsp_data.get_inkey.text.dcs.m_class = MSG_CLASS_RESERVED;
+ tr->terminal_rsp_data.get_inkey.text.dcs.a_format = ALPHABET_FORMAT_8BIT_DATA;
+ tr->terminal_rsp_data.get_inkey.text.string_length = 1;
+ tr->terminal_rsp_data.get_inkey.text.string[0] = 0x01;
+ } else if (inkey_data_len > 0) {
+ tr->terminal_rsp_data.get_inkey.text.string_length = inkey_data_len;
+
+ if (!q_data.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_inkey.alphabet_set) {
+ tr->terminal_rsp_data.get_inkey.text.is_digit_only = TRUE;
tr->terminal_rsp_data.get_inkey.text.dcs.a_format = ALPHABET_FORMAT_8BIT_DATA;
- tr->terminal_rsp_data.get_inkey.text.string_length = 1;
- tr->terminal_rsp_data.get_inkey.text.string[0] = 0x01;
- }
- else if(inkey_data_len > 0)
- {
- tr->terminal_rsp_data.get_inkey.text.string_length = inkey_data_len;
+ tr->terminal_rsp_data.get_inkey.text.dcs.m_class = MSG_CLASS_RESERVED;
- if (!q_data.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_inkey.alphabet_set){
- tr->terminal_rsp_data.get_inkey.text.is_digit_only = TRUE;
- tr->terminal_rsp_data.get_inkey.text.dcs.a_format = ALPHABET_FORMAT_8BIT_DATA;
- tr->terminal_rsp_data.get_inkey.text.dcs.m_class = MSG_CLASS_RESERVED;
+ memcpy((void*)tr->terminal_rsp_data.get_inkey.text.string, inkey_data, inkey_data_len);
+ } else {
+ tr->terminal_rsp_data.get_inkey.text.dcs.m_class = MSG_CLASS_RESERVED;
- memcpy((void*)tr->terminal_rsp_data.get_inkey.text.string, inkey_data, inkey_data_len);
- }
- else
- {
- tr->terminal_rsp_data.get_inkey.text.dcs.m_class = MSG_CLASS_RESERVED;
-
- if(q_data.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_inkey.alphabet_type == INPUT_ALPHABET_TYPE_SMS_DEFAULT )
- {
- int tmp_len;
- char tmp_str[SAT_TEXT_STRING_LEN_MAX + 1], *packed_data;
-
- dbg("sat gsm7 encoding");
- tcore_util_convert_utf8_to_gsm((unsigned char*) tmp_str, &tmp_len, (unsigned char*)inkey_data, inkey_data_len);
- packed_data = (char*) tcore_util_pack_gsm7bit((const unsigned char *)tmp_str, tmp_len);
-
- if(packed_data){
- tr->terminal_rsp_data.get_inkey.text.dcs.a_format = ALPHABET_FORMAT_8BIT_DATA;
- tr->terminal_rsp_data.get_inkey.text.string_length = strlen(packed_data);
- memcpy((void*) tr->terminal_rsp_data.get_inkey.text.string, packed_data, strlen(packed_data));
-
- g_free(packed_data);
- }
- }
- else if(q_data.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_inkey.alphabet_type == INPUT_ALPHABET_TYPE_UCS2 )
- {
- char *tmp = NULL;
- dbg("UCS2 DATA");
+ if (q_data.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_inkey.alphabet_type == INPUT_ALPHABET_TYPE_SMS_DEFAULT) {
+ int tmp_len;
+ char tmp_str[SAT_TEXT_STRING_LEN_MAX + 1], *packed_data;
- tr->terminal_rsp_data.get_inkey.text.dcs.a_format = ALPHABET_FORMAT_UCS2;
- tcore_util_convert_utf8_to_ucs2(&tmp,
- &tr->terminal_rsp_data.get_inkey.text.string_length, (unsigned char*)inkey_data, inkey_data_len);
+ dbg("sat gsm7 encoding");
+ tcore_util_convert_utf8_to_gsm((unsigned char*) tmp_str, &tmp_len, (unsigned char*)inkey_data, inkey_data_len);
+ packed_data = (char*) tcore_util_pack_gsm7bit((const unsigned char *)tmp_str, tmp_len);
- memcpy(tr->terminal_rsp_data.get_inkey.text.string, tmp, tr->terminal_rsp_data.get_inkey.text.string_length);
- g_free(tmp);
- }
- else
- {
- tr->terminal_rsp_data.get_inkey.text.dcs.a_format = ALPHABET_FORMAT_RESERVED;
- dbg("[SAT] invalid DCS[%d]",tr->terminal_rsp_data.get_inkey.text.dcs.a_format);
+ if (packed_data) {
+ tr->terminal_rsp_data.get_inkey.text.dcs.a_format = ALPHABET_FORMAT_8BIT_DATA;
+ tr->terminal_rsp_data.get_inkey.text.string_length = strlen(packed_data);
+ memcpy((void*) tr->terminal_rsp_data.get_inkey.text.string, packed_data, strlen(packed_data));
+ g_free(packed_data);
}
+ } else if (q_data.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_inkey.alphabet_type == INPUT_ALPHABET_TYPE_UCS2) {
+ char *tmp = NULL;
+ dbg("UCS2 DATA");
+
+ tr->terminal_rsp_data.get_inkey.text.dcs.a_format = ALPHABET_FORMAT_UCS2;
+ tcore_util_convert_utf8_to_ucs2(&tmp,
+ &tr->terminal_rsp_data.get_inkey.text.string_length, (unsigned char*)inkey_data, inkey_data_len);
+
+ memcpy(tr->terminal_rsp_data.get_inkey.text.string, tmp, tr->terminal_rsp_data.get_inkey.text.string_length);
+ g_free(tmp);
+ } else {
+ tr->terminal_rsp_data.get_inkey.text.dcs.a_format = ALPHABET_FORMAT_RESERVED;
+ dbg("[SAT] invalid DCS[%d]", tr->terminal_rsp_data.get_inkey.text.dcs.a_format);
}
}
- break;
+ }
+ break;
- case USER_CONFIRM_HELP_INFO:
- tr->terminal_rsp_data.get_inkey.result_type = RESULT_HELP_INFO_REQUIRED_BY_USER;
- //TODO ctx->help_requested = TRUE;
- break;
+ case USER_CONFIRM_HELP_INFO:
+ tr->terminal_rsp_data.get_inkey.result_type = RESULT_HELP_INFO_REQUIRED_BY_USER;
+ /* TODO ctx->help_requested = TRUE; */
+ break;
- case USER_CONFIRM_NO_OR_CANCEL:
- tr->terminal_rsp_data.get_inkey.result_type = RESULT_BACKWARD_MOVE_BY_USER;
+ case USER_CONFIRM_NO_OR_CANCEL:
+ tr->terminal_rsp_data.get_inkey.result_type = RESULT_BACKWARD_MOVE_BY_USER;
- if (q_data.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_inkey.inkey_type == INKEY_TYPE_YES_NO_REQUESTED) {
- tr->terminal_rsp_data.get_inkey.result_type = RESULT_SUCCESS;
- tr->terminal_rsp_data.get_inkey.text.dcs.m_class = MSG_CLASS_RESERVED;
- tr->terminal_rsp_data.get_inkey.text.dcs.a_format = ALPHABET_FORMAT_8BIT_DATA;
- tr->terminal_rsp_data.get_inkey.text.string_length = 1;
- tr->terminal_rsp_data.get_inkey.text.string[0] = 0x00;
- }
- break;
+ if (q_data.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_inkey.inkey_type == INKEY_TYPE_YES_NO_REQUESTED) {
+ tr->terminal_rsp_data.get_inkey.result_type = RESULT_SUCCESS;
+ tr->terminal_rsp_data.get_inkey.text.dcs.m_class = MSG_CLASS_RESERVED;
+ tr->terminal_rsp_data.get_inkey.text.dcs.a_format = ALPHABET_FORMAT_8BIT_DATA;
+ tr->terminal_rsp_data.get_inkey.text.string_length = 1;
+ tr->terminal_rsp_data.get_inkey.text.string[0] = 0x00;
+ }
+ break;
- case USER_CONFIRM_TIMEOUT:
- tr->terminal_rsp_data.get_inkey.result_type = RESULT_NO_RESPONSE_FROM_USER;
- break;
+ case USER_CONFIRM_TIMEOUT:
+ tr->terminal_rsp_data.get_inkey.result_type = RESULT_NO_RESPONSE_FROM_USER;
+ if (q_data.cmd_data.getInkeyInd.duration.time_interval != 0) {
+ tr->terminal_rsp_data.get_inkey.duration.time_interval = q_data.cmd_data.getInkeyInd.duration.time_interval;
+ tr->terminal_rsp_data.get_inkey.duration.time_unit = q_data.cmd_data.getInkeyInd.duration.time_unit;
+ }
+ break;
- case USER_CONFIRM_END:
- tr->terminal_rsp_data.get_inkey.result_type = RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
- break;
+ case USER_CONFIRM_END:
+ tr->terminal_rsp_data.get_inkey.result_type = RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
+ break;
- default:
- dbg("not handled value[%d] here", confirm_type);
- break;
+ default:
+ dbg("not handled value[%d] here", confirm_type);
+ break;
}
result = TRUE;
rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
+ if (rv != TCORE_RETURN_SUCCESS) {
dbg("fail to send terminal response");
result = FALSE;
}
return result;
}
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return result;
}
- if(addtional_data){
+ if (addtional_data) {
int local_index = 0;
guchar data;
GVariantIter *iter = NULL;
dbg("additional data exist type_format(%s)", g_variant_get_type_string(inner_gv));
g_variant_get(inner_gv, "ay", &iter);
- while( g_variant_iter_loop (iter, "y", &data)){
+ while (g_variant_iter_loop(iter, "y", &data)) {
dbg("index(%d) data(%d)", local_index, data);
input_data[local_index] = data;
local_index++;
tr->terminal_rsp_data.get_input.device_id.src = DEVICE_ID_ME;
tr->terminal_rsp_data.get_input.device_id.dest = DEVICE_ID_SIM;
- switch (confirm_type){
- case USER_CONFIRM_YES:
- tr->terminal_rsp_data.get_input.result_type = RESULT_SUCCESS;
- tr->terminal_rsp_data.get_input.text.dcs.m_class = MSG_CLASS_RESERVED;
-
- if(!q_data.cmd_data.getInputInd.command_detail.cmd_qualifier.get_input.alphabet_set){
- tr->terminal_rsp_data.get_input.text.is_digit_only = TRUE;
- }
-
- if(q_data.cmd_data.getInputInd.text_attribute.b_txt_attr)
- tr->terminal_rsp_data.get_input.result_type = RESULT_SUCCESS_WITH_PARTIAL_COMPREHENSION;
-
- if (q_data.cmd_data.getInputInd.icon_id.is_exist)
- tr->terminal_rsp_data.get_input.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
-
- if(!q_data.cmd_data.getInputInd.command_detail.cmd_qualifier.get_input.user_input_unpacked_format){
- dbg("[SAT] packing to SMS7 default");
-
- tr->terminal_rsp_data.get_input.text.string_length = 0;
- tr->terminal_rsp_data.get_input.text.dcs.a_format = ALPHABET_FORMAT_SMS_DEFAULT;
-
- if (input_data_len > 0){
- int tmp_len;
- char tmp_str[SAT_TEXT_STRING_LEN_MAX + 1], *packed_data;
-
- dbg("sat gsm7 encoding");
- tcore_util_convert_utf8_to_gsm((unsigned char*)tmp_str, &tmp_len, (unsigned char*)input_data, input_data_len);
- packed_data = (char*) tcore_util_pack_gsm7bit((const unsigned char *)tmp_str, tmp_len);
+ switch (confirm_type) {
+ case USER_CONFIRM_YES:
+ tr->terminal_rsp_data.get_input.result_type = RESULT_SUCCESS;
+ tr->terminal_rsp_data.get_input.text.dcs.m_class = MSG_CLASS_RESERVED;
- if(packed_data){
- memcpy((void*)tr->terminal_rsp_data.get_input.text.string, packed_data, strlen(packed_data));
- tr->terminal_rsp_data.get_input.text.string_length = strlen(packed_data);
+ if (!q_data.cmd_data.getInputInd.command_detail.cmd_qualifier.get_input.alphabet_set)
+ tr->terminal_rsp_data.get_input.text.is_digit_only = TRUE;
- g_free(packed_data);
- }
- }
+ if (q_data.cmd_data.getInputInd.text_attribute.b_txt_attr)
+ tr->terminal_rsp_data.get_input.result_type = RESULT_SUCCESS_WITH_PARTIAL_COMPREHENSION;
- }
- else
- {
- dbg("[SAT] packing not required");
+ if (q_data.cmd_data.getInputInd.icon_id.is_exist)
+ tr->terminal_rsp_data.get_input.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
- if(q_data.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_input.alphabet_type == INPUT_ALPHABET_TYPE_SMS_DEFAULT){
+ if (!q_data.cmd_data.getInputInd.command_detail.cmd_qualifier.get_input.user_input_unpacked_format) {
+ dbg("[SAT] packing to SMS7 default");
- tr->terminal_rsp_data.get_input.text.dcs.a_format = ALPHABET_FORMAT_8BIT_DATA;
- tcore_util_convert_utf8_to_gsm((unsigned char*)tr->terminal_rsp_data.get_input.text.string,
- &tr->terminal_rsp_data.get_input.text.string_length, (unsigned char*)input_data, input_data_len);
+ tr->terminal_rsp_data.get_input.text.string_length = 0;
+ tr->terminal_rsp_data.get_input.text.dcs.a_format = ALPHABET_FORMAT_SMS_DEFAULT;
- }
- else if(q_data.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_input.alphabet_type == INPUT_ALPHABET_TYPE_UCS2 ){
- char *tmp = NULL;
+ if (input_data_len > 0) {
+ int tmp_len;
+ char tmp_str[SAT_TEXT_STRING_LEN_MAX + 1], *packed_data;
- tr->terminal_rsp_data.get_input.text.dcs.a_format = ALPHABET_FORMAT_UCS2;
- tcore_util_convert_utf8_to_ucs2(&tmp, &tr->terminal_rsp_data.get_input.text.string_length, (unsigned char*)input_data, input_data_len);
+ dbg("sat gsm7 encoding");
+ tcore_util_convert_utf8_to_gsm((unsigned char*)tmp_str, &tmp_len, (unsigned char*)input_data, input_data_len);
+ packed_data = (char*) tcore_util_pack_gsm7bit((const unsigned char *)tmp_str, tmp_len);
- memcpy(tr->terminal_rsp_data.get_input.text.string, tmp, tr->terminal_rsp_data.get_input.text.string_length);
- g_free(tmp);
- }
- else{
- tr->terminal_rsp_data.get_input.text.dcs.a_format = ALPHABET_FORMAT_RESERVED;
- dbg("[SAT] invalid DCS[%d]",tr->terminal_rsp_data.get_input.text.dcs.a_format);
+ if (packed_data) {
+ memcpy((void*)tr->terminal_rsp_data.get_input.text.string, packed_data, strlen(packed_data));
+ tr->terminal_rsp_data.get_input.text.string_length = strlen(packed_data);
+
+ g_free(packed_data);
}
- } break;
+ }
+ } else {
+ dbg("[SAT] packing not required");
+
+ if (q_data.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_input.alphabet_type == INPUT_ALPHABET_TYPE_SMS_DEFAULT) {
+ tr->terminal_rsp_data.get_input.text.dcs.a_format = ALPHABET_FORMAT_8BIT_DATA;
+ tcore_util_convert_utf8_to_gsm((unsigned char*)tr->terminal_rsp_data.get_input.text.string,
+ &tr->terminal_rsp_data.get_input.text.string_length, (unsigned char*)input_data, input_data_len);
+ } else if (q_data.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_input.alphabet_type == INPUT_ALPHABET_TYPE_UCS2) {
+ char *tmp = NULL;
- case USER_CONFIRM_HELP_INFO:
- tr->terminal_rsp_data.get_input.result_type = RESULT_HELP_INFO_REQUIRED_BY_USER;
- //TODO ctx->help_requested = TRUE;
- break;
+ tr->terminal_rsp_data.get_input.text.dcs.a_format = ALPHABET_FORMAT_UCS2;
+ tcore_util_convert_utf8_to_ucs2(&tmp, &tr->terminal_rsp_data.get_input.text.string_length, (unsigned char*)input_data, input_data_len);
+ memcpy(tr->terminal_rsp_data.get_input.text.string, tmp, tr->terminal_rsp_data.get_input.text.string_length);
+ g_free(tmp);
+ } else {
+ tr->terminal_rsp_data.get_input.text.dcs.a_format = ALPHABET_FORMAT_RESERVED;
+ dbg("[SAT] invalid DCS[%d]", tr->terminal_rsp_data.get_input.text.dcs.a_format);
+ }
+ } break;
- case USER_CONFIRM_NO_OR_CANCEL:
- tr->terminal_rsp_data.get_input.result_type = RESULT_BACKWARD_MOVE_BY_USER;
- break;
+ case USER_CONFIRM_HELP_INFO:
+ tr->terminal_rsp_data.get_input.result_type = RESULT_HELP_INFO_REQUIRED_BY_USER;
+ /* TODO ctx->help_requested = TRUE; */
+ break;
- case USER_CONFIRM_TIMEOUT:
- tr->terminal_rsp_data.get_input.result_type = RESULT_NO_RESPONSE_FROM_USER;
- break;
+ case USER_CONFIRM_NO_OR_CANCEL:
+ tr->terminal_rsp_data.get_input.result_type = RESULT_BACKWARD_MOVE_BY_USER;
+ break;
- case USER_CONFIRM_END:
- tr->terminal_rsp_data.get_input.result_type = RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
- break;
- default:
- break;
+ case USER_CONFIRM_TIMEOUT:
+ tr->terminal_rsp_data.get_input.result_type = RESULT_NO_RESPONSE_FROM_USER;
+ break;
+
+ case USER_CONFIRM_END:
+ tr->terminal_rsp_data.get_input.result_type = RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
+ break;
+ default:
+ break;
}
result = TRUE;
rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
+ if (rv != TCORE_RETURN_SUCCESS) {
dbg("fail to send terminal response");
result = FALSE;
}
return result;
}
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return result;
}
dbg("additional data exist type_format(%s)", g_variant_get_type_string(inner_gv));
g_variant_get(inner_gv, "ay", &iter);
- while( g_variant_iter_loop (iter, "y", &data)){
+ while (g_variant_iter_loop(iter, "y", &data)) {
dbg("index(%d) data(%d)", local_index, data);
input_data[local_index] = data;
local_index++;
tr->terminal_rsp_data.setup_call.device_id.src = DEVICE_ID_ME;
tr->terminal_rsp_data.setup_call.device_id.dest = q_data.cmd_data.setup_call.device_id.src;
- switch(confirm_type){
- case USER_CONFIRM_YES:{
- char *path;
- TelephonySAT *sat;
- TelephonyObjectSkeleton *object;
-
- const gchar *cp_name;
- GVariant *setup_call = NULL;
-
- gint command_id, call_type, confirmed_text_len, text_len, duration;
- gchar *confirmed_text = NULL, *text = NULL, *call_number = NULL;
+ switch (confirm_type) {
+ case USER_CONFIRM_YES:{
+ char *path;
+ TelephonySAT *sat;
+ TelephonyObjectSkeleton *object;
+ const gchar *cp_name;
+ GVariant *setup_call = NULL;
+ gint command_id, call_type, confirmed_text_len, text_len, duration;
+ gchar *confirmed_text = NULL, *text = NULL, *call_number = NULL;
#if defined(TIZEN_SUPPORT_SAT_ICON)
- GVariant *icon_id;
+ GVariant *icon_id;
#endif
- enum dbus_tapi_sim_slot_id slot_id;
- gboolean call_app_rv;
- cp_name = tcore_server_get_cp_name_by_plugin(plg);
- if (cp_name == NULL) {
- err("CP name is NULL");
- goto Exit;
- }
+ cp_name = tcore_server_get_cp_name_by_plugin(plg);
+ if (cp_name == NULL) {
+ err("CP name is NULL");
+ goto Exit;
+ }
- dbg("CP Name: [%s]", cp_name);
- path = g_strdup_printf("%s/%s", MY_DBUS_PATH, cp_name);
+ dbg("CP Name: [%s]", cp_name);
+ path = g_strdup_printf("%s/%s", MY_DBUS_PATH, cp_name);
- /* Look-up Hash table for Object */
- object = g_hash_table_lookup(ctx->objects, path);
- dbg("Path: [%s] Interface object: [%p]", path, object);
- g_free(path);
- if (object == NULL) {
- err("Object is NOT defined!!!");
- goto Exit;
- }
+ /* Look-up Hash table for Object */
+ object = g_hash_table_lookup(ctx->objects, path);
+ dbg("Path: [%s] Interface object: [%p]", path, object);
+ g_free(path);
+ if (object == NULL) {
+ err("Object is NOT defined!!!");
+ goto Exit;
+ }
- sat = telephony_object_peek_sat(TELEPHONY_OBJECT(object));
+ sat = telephony_object_peek_sat(TELEPHONY_OBJECT(object));
- setup_call = sat_manager_setup_call_noti(ctx, cp_name, &q_data.cmd_data.setup_call);
+ setup_call = sat_manager_setup_call_noti(ctx, cp_name, &q_data.cmd_data.setup_call);
- dbg("setup call type_format(%s)", g_variant_get_type_string(setup_call));
+ dbg("setup call type_format(%s)", g_variant_get_type_string(setup_call));
#if defined(TIZEN_SUPPORT_SAT_ICON)
- g_variant_get(setup_call, "(isisi@visi)", &command_id, &confirmed_text, &confirmed_text_len, &text, &text_len, &icon_id, &call_type, &call_number, &duration);
+ g_variant_get(setup_call, "(isisi@visi)", &command_id,
+ &confirmed_text, &confirmed_text_len, &text, &text_len,
+ &icon_id, &call_type, &call_number, &duration);
- telephony_sat_emit_setup_call(sat, command_id, confirmed_text, confirmed_text_len, text, text_len, icon_id, call_type,
- call_number, duration);
+ telephony_sat_emit_setup_call(sat, command_id, confirmed_text,
+ confirmed_text_len, text, text_len, icon_id, call_type,
+ call_number, duration);
#else
- g_variant_get(setup_call, "(isisiisi)", &command_id, &confirmed_text, &confirmed_text_len, &text, &text_len, &call_type, &call_number, &duration);
+ g_variant_get(setup_call, "(isisiisi)", &command_id,
+ &confirmed_text, &confirmed_text_len, &text, &text_len,
+ &call_type, &call_number, &duration);
- telephony_sat_emit_setup_call(sat, command_id, confirmed_text, confirmed_text_len, text, text_len, call_type,
- call_number, duration);
+ telephony_sat_emit_setup_call(sat, command_id, confirmed_text,
+ confirmed_text_len, text, text_len, call_type,
+ call_number, duration);
#endif
- g_free(confirmed_text);
- g_free(text);
- g_free(call_number);
-
- slot_id = get_sim_slot_id_by_cp_name((char *)tcore_server_get_cp_name_by_plugin(plg));
- dbg("slot_id: [%d]", slot_id);
+ g_free(confirmed_text);
+ g_free(text);
+ g_free(call_number);
- call_app_rv = sat_ui_support_launch_call_application(q_data.cmd_data.setup_call.command_detail.cmd_type, setup_call, slot_id);
- free (tr);
+ free(tr);
- return call_app_rv;
- }
+ dbg("user confirmation %d", USER_CONFIRM_YES);
+ return TRUE;
+ }
- case USER_CONFIRM_NO_OR_CANCEL:{
- tr->terminal_rsp_data.setup_call.result_type = RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
- }break;
+ case USER_CONFIRM_NO_OR_CANCEL: {
+ tr->terminal_rsp_data.setup_call.result_type = RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
+ } break;
- case USER_CONFIRM_END:{
- tr->terminal_rsp_data.setup_call.result_type = RESULT_USER_DID_NOT_ACCEPT_CALL_SETUP_REQ;
- }break;
+ case USER_CONFIRM_END: {
+ tr->terminal_rsp_data.setup_call.result_type = RESULT_USER_DID_NOT_ACCEPT_CALL_SETUP_REQ;
+ } break;
- case USER_CONFIRM_HELP_INFO:
- default:
- tr->terminal_rsp_data.setup_call.result_type = RESULT_NO_RESPONSE_FROM_USER;
+ case USER_CONFIRM_HELP_INFO:
+ default:
+ tr->terminal_rsp_data.setup_call.result_type = RESULT_NO_RESPONSE_FROM_USER;
break;
}
result = TRUE;
rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
+ if (rv != TCORE_RETURN_SUCCESS) {
dbg("fail to send terminal response");
result = FALSE;
}
+
Exit:
- free (tr);
+ free(tr);
return result;
}
return result;
}
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return result;
}
dbg("confirm_type[%d]", confirm_type);
- switch(confirm_type){
- case USER_CONFIRM_NO_OR_CANCEL:
- case USER_CONFIRM_END:
- tr->terminal_rsp_data.send_dtmf.result_type = RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
- tr->terminal_rsp_data.send_dtmf.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
- default:
- tr->terminal_rsp_data.send_dtmf.result_type = RESULT_NO_RESPONSE_FROM_USER;
- break;
+ switch (confirm_type) {
+ case USER_CONFIRM_NO_OR_CANCEL:
+ case USER_CONFIRM_END:
+ tr->terminal_rsp_data.send_dtmf.result_type = RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
+ tr->terminal_rsp_data.send_dtmf.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
+ break;
+ default:
+ tr->terminal_rsp_data.send_dtmf.result_type = RESULT_NO_RESPONSE_FROM_USER;
+ break;
}
result = TRUE;
rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
+ if (rv != TCORE_RETURN_SUCCESS) {
dbg("fail to send terminal response");
result = FALSE;
}
return result;
}
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return result;
}
dbg("confirm_type[%d]", confirm_type);
- switch(confirm_type){
+ switch (confirm_type) {
case USER_CONFIRM_YES:{
char *path;
TelephonySAT *sat;
gint command_id = 0;
gint browser_launch_type = 0, browser_id = 0;
- gint url_len = 0, text_len = 0, gateway_proxy_len =0;
+ gint url_len = 0, text_len = 0, gateway_proxy_len = 0;
gchar *url = NULL;
gchar *text = NULL;
gchar *gateway_proxy = NULL;
g_free(text);
g_free(gateway_proxy);
- slot_id = get_sim_slot_id_by_cp_name((char*)tcore_server_get_cp_name_by_plugin(plg));
+ slot_id = get_sim_slot_id_by_cp_name(tcore_server_get_cp_name_by_plugin(plg));
dbg("slot_id: [%d]", slot_id);
sat_ui_support_launch_browser_application(q_data.cmd_data.launch_browser.command_detail.cmd_type, launch_browser, slot_id);
g_free(tr);
return TRUE;
- }break;
+ } break;
case USER_CONFIRM_NO_OR_CANCEL:
tr->terminal_rsp_data.launch_browser.result_type = RESULT_BACKWARD_MOVE_BY_USER;
result = TRUE;
rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
+ if (rv != TCORE_RETURN_SUCCESS) {
dbg("fail to send terminal response");
result = FALSE;
}
return result;
}
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return result;
}
dbg("confirm_type[%d]", confirm_type);
- switch(confirm_type){
- case USER_CONFIRM_YES:{
- char *path;
- TelephonyObjectSkeleton *object;
-
- const gchar *cp_name;
-
- GVariant *open_channel = NULL;
-
- gint command_id, bearer_type, protocol_type, dest_addr_type;
- gboolean immediate_link, auto_reconnection, bg_mode;
- gint text_len, buffer_size, port_number;
- gchar *text = NULL, *dest_address = NULL;
+ switch (confirm_type) {
+ case USER_CONFIRM_YES:{
+ char *path;
+ TelephonyObjectSkeleton *object;
+ const gchar *cp_name;
+ GVariant *open_channel = NULL;
+ gint command_id, bearer_type, protocol_type, dest_addr_type;
+ gboolean immediate_link, auto_reconnection, bg_mode;
+ gint text_len, buffer_size, port_number;
+ gchar *text = NULL, *dest_address = NULL;
#if defined(TIZEN_SUPPORT_SAT_ICON)
- GVariant *icon_id;
+ GVariant *icon_id;
#endif
- GVariant *bearer_param;
- GVariant *bearer_detail;
+ GVariant *bearer_param;
+ GVariant *bearer_detail;
- //emit send_dtmf signal
- cp_name = tcore_server_get_cp_name_by_plugin(plg);
- if (cp_name == NULL) {
- err("CP name is NULL");
- goto Exit;
- }
+ /* emit send_dtmf signal */
+ cp_name = tcore_server_get_cp_name_by_plugin(plg);
+ if (cp_name == NULL) {
+ err("CP name is NULL");
+ goto Exit;
+ }
- dbg("CP Name: [%s]", cp_name);
- path = g_strdup_printf("%s/%s", MY_DBUS_PATH, cp_name);
+ dbg("CP Name: [%s]", cp_name);
+ path = g_strdup_printf("%s/%s", MY_DBUS_PATH, cp_name);
- /* Look-up Hash table for Object */
- object = g_hash_table_lookup(ctx->objects, path);
- dbg("Path: [%s] Interface object: [%p]", path, object);
- g_free(path);
- if (object == NULL) {
- err("Object is NOT defined!!!");
- goto Exit;
- }
+ /* Look-up Hash table for Object */
+ object = g_hash_table_lookup(ctx->objects, path);
+ dbg("Path: [%s] Interface object: [%p]", path, object);
+ g_free(path);
+ if (object == NULL) {
+ err("Object is NOT defined!!!");
+ goto Exit;
+ }
- open_channel = sat_manager_open_channel_noti(ctx, cp_name, &q_data.cmd_data.open_channel);
+ open_channel = sat_manager_open_channel_noti(ctx, cp_name, &q_data.cmd_data.open_channel);
- dbg("open channel type_format(%s)", g_variant_get_type_string(open_channel));
+ dbg("open channel type_format(%s)", g_variant_get_type_string(open_channel));
#if defined(TIZEN_SUPPORT_SAT_ICON)
- g_variant_get(open_channel,"(isi@vbbbi@viiiis@v)", &command_id, &text, &text_len, &icon_id, &immediate_link, &auto_reconnection, &bg_mode,
- &bearer_type, &bearer_param, &buffer_size, &protocol_type, &port_number, &dest_addr_type, &dest_address, &bearer_detail);
+ g_variant_get(open_channel, "(isi@vbbbi@viiiis@v)", &command_id,
+ &text, &text_len, &icon_id, &immediate_link, &auto_reconnection, &bg_mode,
+ &bearer_type, &bearer_param, &buffer_size, &protocol_type, &port_number,
+ &dest_addr_type, &dest_address, &bearer_detail);
#else
- g_variant_get(open_channel,"(isibbbi@viiiis@v)", &command_id, &text, &text_len, &immediate_link, &auto_reconnection, &bg_mode,
- &bearer_type, &bearer_param, &buffer_size, &protocol_type, &port_number, &dest_addr_type, &dest_address, &bearer_detail);
+ g_variant_get(open_channel, "(isibbbi@viiiis@v)", &command_id,
+ &text, &text_len, &immediate_link, &auto_reconnection, &bg_mode,
+ &bearer_type, &bearer_param, &buffer_size, &protocol_type,
+ &port_number, &dest_addr_type, &dest_address, &bearer_detail);
#endif
- /*telephony_sat_emit_open_channel(sat, command_id, text, text_len, immediate_link, auto_reconnection, bg_mode,
- bearer_type, bearer_param, buffer_size, protocol_type, port_number, dest_addr_type, dest_address, bearer_detail);*/
-
- g_free(text);
- g_free(dest_address);
- //BIP Manager
- {
- GDBusConnection *conn = NULL;
- const gchar *g_path = NULL;
-
- conn = g_dbus_object_manager_server_get_connection(ctx->manager);
- g_path = g_dbus_object_get_object_path(G_DBUS_OBJECT(object));
-
- sat_ui_support_exec_bip(conn, g_path, SAT_PROATV_CMD_OPEN_CHANNEL, open_channel);
- }
+ /* telephony_sat_emit_open_channel(sat, command_id, text, text_len,
+ immediate_link, auto_reconnection, bg_mode, bearer_type,
+ bearer_param, buffer_size, protocol_type, port_number,
+ dest_addr_type, dest_address, bearer_detail); */
+
+ g_free(text);
+ g_free(dest_address);
+ /* BIP Manager */
+ {
+ GDBusConnection *conn = NULL;
+ const gchar *g_path = NULL;
+
+ conn = g_dbus_object_manager_server_get_connection(ctx->manager);
+ g_path = g_dbus_object_get_object_path(G_DBUS_OBJECT(object));
+
+ sat_ui_support_exec_bip(conn, g_path, SAT_PROATV_CMD_OPEN_CHANNEL, open_channel);
+ }
- g_free(tr);
+ g_free(tr);
- return TRUE;
- }break;
+ return TRUE;
+ } break;
- case USER_CONFIRM_NO_OR_CANCEL:
- case USER_CONFIRM_END:
- tr->terminal_rsp_data.open_channel.result_type = RESULT_USER_DID_NOT_ACCEPT_CALL_SETUP_REQ;
- break;
- default:
- tr->terminal_rsp_data.open_channel.result_type = RESULT_NO_RESPONSE_FROM_USER;
- break;
+ case USER_CONFIRM_NO_OR_CANCEL:
+ case USER_CONFIRM_END:
+ tr->terminal_rsp_data.open_channel.result_type = RESULT_USER_DID_NOT_ACCEPT_CALL_SETUP_REQ;
+ break;
+ default:
+ tr->terminal_rsp_data.open_channel.result_type = RESULT_NO_RESPONSE_FROM_USER;
+ break;
}
memcpy((void*)&tr->terminal_rsp_data.open_channel.bearer_desc, &q_data.cmd_data.open_channel.bearer_desc, sizeof(struct tel_sat_bearer_description));
result = TRUE;
rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
+ if (rv != TCORE_RETURN_SUCCESS) {
dbg("fail to send terminal response");
result = FALSE;
}
return result;
}
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return result;
}
dbg("confirm_type[%d]", confirm_type);
- switch(confirm_type){
- case USER_CONFIRM_YES:
- case USER_CONFIRM_NO_OR_CANCEL:
- case USER_CONFIRM_END:
- conf_data->user_conf = confirm_type;
- break;
- default:
- dbg("Not handled confirm type!");
- break;
+ switch (confirm_type) {
+ case USER_CONFIRM_YES:
+ case USER_CONFIRM_NO_OR_CANCEL:
+ case USER_CONFIRM_END:
+ conf_data->user_conf = confirm_type;
+ break;
+ default:
+ dbg("Not handled confirm type!");
+ break;
}
result = TRUE;
rv = sat_manager_send_user_confirmation(ctx->comm, plg, conf_data);
- if(rv != TCORE_RETURN_SUCCESS){
+ if (rv != TCORE_RETURN_SUCCESS) {
dbg("fail to send user confirmation message");
result = FALSE;
}
dbg("[SAT] user confirm data command id(%d), confirm_type(%d)", command_id, confirm_type);
rv = sat_manager_queue_peek_data_by_id(ctx, &q_data, command_id);
- if(!rv){
+ if (!rv) {
dbg("[SAT] no commands in queue");
return result;
}
command_type = (gint)q_data.cmd_type;
dbg("[SAT] command type(%d)", command_type);
- switch(command_type){
- case SAT_PROATV_CMD_SELECT_ITEM:
- result = _sat_manager_handle_menu_select_confirm(ctx, plg, command_id, confirm_type, additional_data);
- break;
- case SAT_PROATV_CMD_DISPLAY_TEXT:
- result = _sat_manager_handle_display_text_confirm(ctx, plg, command_id, confirm_type, additional_data);
- break;
- case SAT_PROATV_CMD_GET_INKEY:
- result = _sat_manager_handle_get_inkey_confirm(ctx, plg, command_id, confirm_type, additional_data);
- break;
- case SAT_PROATV_CMD_GET_INPUT:
- result = _sat_manager_handle_get_input_confirm(ctx, plg, command_id, confirm_type, additional_data);
- break;
- case SAT_PROATV_CMD_SETUP_CALL:
- result = _sat_manager_handle_setup_call_confirm(ctx, plg, command_id, confirm_type, additional_data);
- break;
- case SAT_PROATV_CMD_SEND_DTMF:
- result = _sat_manager_handle_send_dtmf_confirm(ctx, plg, command_id, confirm_type, additional_data);
- break;
- case SAT_PROATV_CMD_LAUNCH_BROWSER:
- result = _sat_manager_handle_launch_browser_confirm(ctx, plg, command_id, confirm_type, additional_data);
- break;
- case SAT_PROATV_CMD_OPEN_CHANNEL:
- result = _sat_manager_handle_open_channel_confirm(ctx, plg, command_id, confirm_type, additional_data);
- break;
- default:
- dbg("[SAT] cannot handle user confirm command(0x%x)", command_type);
- break;
+ switch (command_type) {
+ case SAT_PROATV_CMD_SELECT_ITEM:
+ result = _sat_manager_handle_menu_select_confirm(ctx, plg, command_id, confirm_type, additional_data);
+ break;
+ case SAT_PROATV_CMD_DISPLAY_TEXT:
+ result = _sat_manager_handle_display_text_confirm(ctx, plg, command_id, confirm_type, additional_data);
+ break;
+ case SAT_PROATV_CMD_GET_INKEY:
+ result = _sat_manager_handle_get_inkey_confirm(ctx, plg, command_id, confirm_type, additional_data);
+ break;
+ case SAT_PROATV_CMD_GET_INPUT:
+ result = _sat_manager_handle_get_input_confirm(ctx, plg, command_id, confirm_type, additional_data);
+ break;
+ case SAT_PROATV_CMD_SETUP_CALL:
+ result = _sat_manager_handle_setup_call_confirm(ctx, plg, command_id, confirm_type, additional_data);
+ break;
+ case SAT_PROATV_CMD_SEND_DTMF:
+ result = _sat_manager_handle_send_dtmf_confirm(ctx, plg, command_id, confirm_type, additional_data);
+ break;
+ case SAT_PROATV_CMD_LAUNCH_BROWSER:
+ result = _sat_manager_handle_launch_browser_confirm(ctx, plg, command_id, confirm_type, additional_data);
+ break;
+ case SAT_PROATV_CMD_OPEN_CHANNEL:
+ result = _sat_manager_handle_open_channel_confirm(ctx, plg, command_id, confirm_type, additional_data);
+ break;
+ default:
+ dbg("[SAT] cannot handle user confirm command(0x%x)", command_type);
+ break;
}
return result;
}
-static gboolean _sat_manager_handle_play_tone_ui_display_status(struct custom_data *ctx, TcorePlugin *plg,struct sat_manager_queue_data *q_data, gboolean display_status)
+static gboolean _sat_manager_handle_play_tone_ui_display_status(struct custom_data *ctx,
+ TcorePlugin *plg, struct sat_manager_queue_data *q_data, gboolean display_status)
{
char *path;
TelephonySAT *sat;
#if defined(TIZEN_SUPPORT_SAT_ICON)
GVariant *icon_id;
#endif
- if(!display_status){
+ if (!display_status) {
struct treq_sat_terminal_rsp_data *tr = NULL;
dbg("[SAT] fail to show ui display for play tone");
tr->terminal_rsp_data.play_tone.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
sat_manager_send_terminal_response(ctx->comm, plg, tr);
- free (tr);
+ free(tr);
return TRUE;
}
- //emit play tone signal
+ /* emit play tone signal */
cp_name = tcore_server_get_cp_name_by_plugin(plg);
if (cp_name == NULL) {
err("CP name is NULL");
return TRUE;
}
-static gboolean _sat_manager_handle_setup_idle_mode_text_ui_display_status(struct custom_data *ctx, TcorePlugin *plg,struct sat_manager_queue_data *q_data, gboolean display_status)
+static gboolean _sat_manager_handle_setup_idle_mode_text_ui_display_status(struct custom_data *ctx,
+ TcorePlugin *plg, struct sat_manager_queue_data *q_data, gboolean display_status)
{
TReturn rv = TCORE_RETURN_FAILURE;
gboolean result = FALSE;
struct treq_sat_terminal_rsp_data *tr;
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return result;
}
if (q_data->cmd_data.idle_mode.icon_id.is_exist)
tr->terminal_rsp_data.setup_idle_mode_text.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
- //fail to display text
- if(!display_status){
+ /* fail to display text */
+ if (!display_status) {
dbg("[SAT] fail to show ui display for setup_idle_mode_text");
tr->terminal_rsp_data.setup_idle_mode_text.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
}
result = TRUE;
rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
+ if (rv != TCORE_RETURN_SUCCESS) {
dbg("fail to send terminal response");
result = FALSE;
}
return result;
}
-static gboolean _sat_manager_handle_refresh_ui_display_status(struct custom_data *ctx, TcorePlugin *plg,struct sat_manager_queue_data *q_data, gboolean display_status)
+static gboolean _sat_manager_handle_refresh_ui_display_status(struct custom_data *ctx,
+ TcorePlugin *plg, struct sat_manager_queue_data *q_data, gboolean display_status)
{
struct treq_sat_terminal_rsp_data tr;
tr.terminal_rsp_data.refresh.device_id.src = q_data->cmd_data.refresh.device_id.dest;
tr.terminal_rsp_data.refresh.device_id.dest = q_data->cmd_data.refresh.device_id.src;
- if(!display_status){
+ if (!display_status) {
dbg("fail to show ui for refresh");
tr.terminal_rsp_data.refresh.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- }
- else{
+ } else {
dbg("success to show ui for refresh");
tr.terminal_rsp_data.refresh.result_type = RESULT_SUCCESS;
tr.terminal_rsp_data.refresh.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
#if !defined(TIZEN_PLATFORM_USE_QCOM_QMI)
-static gboolean _sat_manager_handle_send_sms_ui_display_status(struct custom_data *ctx, TcorePlugin *plg,struct sat_manager_queue_data *q_data, gboolean display_status)
+static gboolean _sat_manager_handle_send_sms_ui_display_status(struct custom_data *ctx,
+ TcorePlugin *plg, struct sat_manager_queue_data *q_data, gboolean display_status)
{
char *path;
TelephonySAT *sat;
GVariant *icon_id;
#endif
- if(!display_status){
+ if (!display_status) {
struct treq_sat_terminal_rsp_data *tr = NULL;
dbg("[SAT] fail to show ui display for send sms");
tr->terminal_rsp_data.send_sms.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
sat_manager_send_terminal_response(ctx->comm, plg, tr);
- free (tr);
+ free(tr);
return TRUE;
}
- //emit send sms signal
+ /* emit send sms signal */
cp_name = tcore_server_get_cp_name_by_plugin(plg);
if (cp_name == NULL) {
err("CP name is NULL");
return TRUE;
}
-static gboolean _sat_manager_handle_send_ss_ui_display_status(struct custom_data *ctx, TcorePlugin *plg,struct sat_manager_queue_data *q_data, gboolean display_status)
+static gboolean _sat_manager_handle_send_ss_ui_display_status(struct custom_data *ctx,
+ TcorePlugin *plg, struct sat_manager_queue_data *q_data, gboolean display_status)
{
char *path;
TelephonySAT *sat;
#endif
enum dbus_tapi_sim_slot_id slot_id;
- if(!display_status){
+ if (!display_status) {
struct treq_sat_terminal_rsp_data *tr = NULL;
dbg("[SAT] fail to show ui display for send ss");
tr->terminal_rsp_data.send_ss.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
sat_manager_send_terminal_response(ctx->comm, plg, tr);
- free (tr);
+ free(tr);
return TRUE;
}
- //emit send ss signal
+ /* emit send ss signal */
cp_name = tcore_server_get_cp_name_by_plugin(plg);
if (cp_name == NULL) {
err("CP name is NULL");
g_free(text);
g_free(ss_string);
- slot_id = get_sim_slot_id_by_cp_name((char *)tcore_server_get_cp_name_by_plugin(plg));
+ slot_id = get_sim_slot_id_by_cp_name(tcore_server_get_cp_name_by_plugin(plg));
dbg("slot_id: [%d]", slot_id);
sat_ui_support_launch_ciss_application(SAT_PROATV_CMD_SEND_SS, send_ss, slot_id);
return TRUE;
}
-static gboolean _sat_manager_handle_send_ussd_ui_display_status(struct custom_data *ctx, TcorePlugin *plg,struct sat_manager_queue_data *q_data, gboolean display_status)
+static gboolean _sat_manager_handle_send_ussd_ui_display_status(struct custom_data *ctx,
+ TcorePlugin *plg, struct sat_manager_queue_data *q_data, gboolean display_status)
{
char *path;
TelephonySAT *sat;
#endif
enum dbus_tapi_sim_slot_id slot_id;
- if(!display_status){
+ if (!display_status) {
struct treq_sat_terminal_rsp_data *tr = NULL;
dbg("[SAT] fail to show ui display for send ussd");
return TRUE;
}
- //emit send ussd signal
+ /* emit send ussd signal */
cp_name = tcore_server_get_cp_name_by_plugin(plg);
if (cp_name == NULL) {
err("CP name is NULL");
g_free(text);
g_free(ussd_string);
- slot_id = get_sim_slot_id_by_cp_name((char *)tcore_server_get_cp_name_by_plugin(plg));
+ slot_id = get_sim_slot_id_by_cp_name(tcore_server_get_cp_name_by_plugin(plg));
dbg("slot_id: [%d]", slot_id);
- sat_ui_support_launch_ciss_application(SAT_PROATV_CMD_SEND_USSD, send_ussd,slot_id);
+ sat_ui_support_launch_ciss_application(SAT_PROATV_CMD_SEND_USSD, send_ussd, slot_id);
return TRUE;
}
-static gboolean _sat_manager_handle_send_dtmf_ui_display_status(struct custom_data *ctx, TcorePlugin *plg,struct sat_manager_queue_data *q_data, gboolean display_status)
+static gboolean _sat_manager_handle_send_dtmf_ui_display_status(struct custom_data *ctx,
+ TcorePlugin *plg, struct sat_manager_queue_data *q_data, gboolean display_status)
{
char *path;
TelephonySAT *sat;
#if defined(TIZEN_SUPPORT_SAT_ICON)
GVariant *icon_id = NULL;
#endif
- if(!display_status){
+ if (!display_status) {
struct treq_sat_terminal_rsp_data *tr = NULL;
dbg("[SAT] fail to show ui display for send_dtmf");
return TRUE;
}
- //emit send_dtmf signal
+ /* emit send_dtmf signal */
cp_name = tcore_server_get_cp_name_by_plugin(plg);
if (cp_name == NULL) {
err("CP name is NULL");
return TRUE;
}
-static gboolean _sat_manager_handle_open_channel_ui_display_status(struct custom_data *ctx, TcorePlugin *plg,struct sat_manager_queue_data *q_data, gboolean display_status)
+static gboolean _sat_manager_handle_open_channel_ui_display_status(struct custom_data *ctx,
+ TcorePlugin *plg, struct sat_manager_queue_data *q_data, gboolean display_status)
{
char *path;
TelephonyObjectSkeleton *object;
GVariant *icon_id;
#endif
- if(!display_status){
+ if (!display_status) {
struct treq_sat_terminal_rsp_data *tr = NULL;
dbg("[SAT] fail to show ui display for open channel");
return TRUE;
}
- //emit send_dtmf signal
+ /* emit send_dtmf signal */
cp_name = tcore_server_get_cp_name_by_plugin(plg);
if (cp_name == NULL) {
err("CP name is NULL");
dbg("open channel type_format(%s)", g_variant_get_type_string(open_channel));
#if defined(TIZEN_SUPPORT_SAT_ICON)
- g_variant_get(open_channel,"(isi@vbbbi@viiiis@v)", &command_id, &text, &text_len, &icon_id, &immediate_link, &auto_reconnection, &bg_mode,
- &bearer_type, &bearer_param, &buffer_size, &protocol_type, &port_number, &dest_addr_type, &dest_address, &bearer_detail);
+ g_variant_get(open_channel, "(isi@vbbbi@viiiis@v)", &command_id, &text,
+ &text_len, &icon_id, &immediate_link, &auto_reconnection, &bg_mode,
+ &bearer_type, &bearer_param, &buffer_size, &protocol_type, &port_number,
+ &dest_addr_type, &dest_address, &bearer_detail);
#else
- g_variant_get(open_channel,"(isibbbi@viiiis@v)", &command_id, &text, &text_len, &immediate_link, &auto_reconnection, &bg_mode,
- &bearer_type, &bearer_param, &buffer_size, &protocol_type, &port_number, &dest_addr_type, &dest_address, &bearer_detail);
+ g_variant_get(open_channel, "(isibbbi@viiiis@v)", &command_id, &text, &text_len,
+ &immediate_link, &auto_reconnection, &bg_mode, &bearer_type, &bearer_param,
+ &buffer_size, &protocol_type, &port_number, &dest_addr_type, &dest_address, &bearer_detail);
#endif
- /*telephony_sat_emit_open_channel(sat, command_id, text, text_len, immediate_link, auto_reconnection, bg_mode,
- bearer_type, bearer_param, buffer_size, protocol_type, port_number, dest_addr_type, dest_address, bearer_detail);*/
+ /* telephony_sat_emit_open_channel(sat, command_id, text, text_len, immediate_link,
+ auto_reconnection, bg_mode, bearer_type, bearer_param, buffer_size,
+ protocol_type, port_number, dest_addr_type, dest_address, bearer_detail); */
g_free(text);
g_free(dest_address);
- //BIP Manager
+ /* BIP Manager */
{
GDBusConnection *conn = NULL;
const gchar *g_path = NULL;
return result;
}
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return result;
}
- switch(q_data.cmd_type){
- case SAT_PROATV_CMD_PLAY_TONE:
- result = _sat_manager_handle_play_tone_ui_display_status(ctx, plg, &q_data, display_status);
- break;
- case SAT_PROATV_CMD_SEND_SMS:
- result = _sat_manager_handle_send_sms_ui_display_status(ctx, plg, &q_data, display_status);
- break;
- case SAT_PROATV_CMD_SEND_SS:
- result = _sat_manager_handle_send_ss_ui_display_status(ctx, plg, &q_data, display_status);
- break;
- case SAT_PROATV_CMD_SEND_USSD:
- result = _sat_manager_handle_send_ussd_ui_display_status(ctx, plg, &q_data, display_status);
- break;
- case SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT:
- result = _sat_manager_handle_setup_idle_mode_text_ui_display_status(ctx, plg, &q_data, display_status);
- break;
- case SAT_PROATV_CMD_REFRESH:
- result = _sat_manager_handle_refresh_ui_display_status(ctx, plg, &q_data, display_status);
- break;
- case SAT_PROATV_CMD_SEND_DTMF:
- result = _sat_manager_handle_send_dtmf_ui_display_status(ctx, plg, &q_data, display_status);
- break;
- case SAT_PROATV_CMD_OPEN_CHANNEL:
- result = _sat_manager_handle_open_channel_ui_display_status(ctx, plg, &q_data, display_status);
- break;
- default:
- dbg("[SAT] cannot handle ui display status command(0x%x)", q_data.cmd_type);
- break;
+ switch (q_data.cmd_type) {
+ case SAT_PROATV_CMD_PLAY_TONE:
+ result = _sat_manager_handle_play_tone_ui_display_status(ctx, plg, &q_data, display_status);
+ break;
+ case SAT_PROATV_CMD_SEND_SMS:
+ result = _sat_manager_handle_send_sms_ui_display_status(ctx, plg, &q_data, display_status);
+ break;
+ case SAT_PROATV_CMD_SEND_SS:
+ result = _sat_manager_handle_send_ss_ui_display_status(ctx, plg, &q_data, display_status);
+ break;
+ case SAT_PROATV_CMD_SEND_USSD:
+ result = _sat_manager_handle_send_ussd_ui_display_status(ctx, plg, &q_data, display_status);
+ break;
+ case SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT:
+ result = _sat_manager_handle_setup_idle_mode_text_ui_display_status(ctx, plg, &q_data, display_status);
+ break;
+ case SAT_PROATV_CMD_REFRESH:
+ result = _sat_manager_handle_refresh_ui_display_status(ctx, plg, &q_data, display_status);
+ break;
+ case SAT_PROATV_CMD_SEND_DTMF:
+ result = _sat_manager_handle_send_dtmf_ui_display_status(ctx, plg, &q_data, display_status);
+ break;
+ case SAT_PROATV_CMD_OPEN_CHANNEL:
+ result = _sat_manager_handle_open_channel_ui_display_status(ctx, plg, &q_data, display_status);
+ break;
+ default:
+ dbg("[SAT] cannot handle ui display status command(0x%x)", q_data.cmd_type);
+ break;
}
return result;
}
#else
-static gboolean _sat_manager_handle_open_channel_ui_display_status(struct custom_data *ctx, TcorePlugin *plg,struct sat_manager_queue_data *q_data, gboolean display_status)
+static gboolean _sat_manager_handle_open_channel_ui_display_status(struct custom_data *ctx,
+ TcorePlugin *plg, struct sat_manager_queue_data *q_data, gboolean display_status)
{
TReturn rv = TCORE_RETURN_FAILURE;
gboolean result = FALSE;
struct treq_sat_user_confirmation_data *conf_data;
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return result;
}
dbg("display_status[%d]", display_status);
- if(display_status)
+ if (display_status)
conf_data->user_conf = USER_CONFIRM_YES;
else
conf_data->user_conf = USER_CONFIRM_NO_OR_CANCEL;
result = TRUE;
rv = sat_manager_send_user_confirmation(ctx->comm, plg, conf_data);
- if(rv != TCORE_RETURN_SUCCESS){
+ if (rv != TCORE_RETURN_SUCCESS) {
dbg("fail to send user confirmation message");
result = FALSE;
}
return result;
}
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return result;
}
- switch(q_data.cmd_type){
- case SAT_PROATV_CMD_PLAY_TONE:
- result = _sat_manager_handle_play_tone_ui_display_status(ctx, plg, &q_data, display_status);
- break;
- case SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT:
- result = _sat_manager_handle_setup_idle_mode_text_ui_display_status(ctx, plg, &q_data, display_status);
- break;
- case SAT_PROATV_CMD_REFRESH:
- result = _sat_manager_handle_refresh_ui_display_status(ctx, plg, &q_data, display_status);
- break;
- case SAT_PROATV_CMD_OPEN_CHANNEL:
- result = _sat_manager_handle_open_channel_ui_display_status(ctx, plg, &q_data, display_status);
- break;
- case SAT_PROATV_CMD_SEND_SMS:
- case SAT_PROATV_CMD_SEND_SS:
- case SAT_PROATV_CMD_SEND_USSD:
- case SAT_PROATV_CMD_SEND_DTMF:
- dbg("[SAT] command(0x%x) will be handled by CP", q_data.cmd_type);
- result = TRUE;
- if(q_data.noti_required) {
- TelephonySAT *sat;
- TelephonyObjectSkeleton *object;
- const gchar *cp_name;
- gchar *path = NULL;
-
- dbg("Noti flag is set, send session end evt.");
- //emit session end
-
- cp_name = tcore_server_get_cp_name_by_plugin(plg);
- if (cp_name == NULL) {
- err("CP name is NULL");
- return FALSE;
- }
+ switch (q_data.cmd_type) {
+ case SAT_PROATV_CMD_PLAY_TONE:
+ result = _sat_manager_handle_play_tone_ui_display_status(ctx, plg, &q_data, display_status);
+ break;
+ case SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT:
+ result = _sat_manager_handle_setup_idle_mode_text_ui_display_status(ctx, plg, &q_data, display_status);
+ break;
+ case SAT_PROATV_CMD_REFRESH:
+ result = _sat_manager_handle_refresh_ui_display_status(ctx, plg, &q_data, display_status);
+ break;
+ case SAT_PROATV_CMD_OPEN_CHANNEL:
+ result = _sat_manager_handle_open_channel_ui_display_status(ctx, plg, &q_data, display_status);
+ break;
+ case SAT_PROATV_CMD_SEND_SMS:
+ case SAT_PROATV_CMD_SEND_SS:
+ case SAT_PROATV_CMD_SEND_USSD:
+ case SAT_PROATV_CMD_SEND_DTMF:
+ dbg("[SAT] command(0x%x) will be handled by CP", q_data.cmd_type);
+ result = TRUE;
+ if (q_data.noti_required) {
+ TelephonySAT *sat;
+ TelephonyObjectSkeleton *object;
+ const gchar *cp_name;
+ gchar *path = NULL;
- dbg("CP Name: [%s]", cp_name);
- path = g_strdup_printf("%s/%s", MY_DBUS_PATH, cp_name);
+ dbg("Noti flag is set, send session end evt.");
+ /* emit session end */
- /* Look-up Hash table for Object */
- object = g_hash_table_lookup(ctx->objects, path);
- dbg("Path: [%s] Interface object: [%p]", path, object);
- g_free(path);
- if (object == NULL) {
- err("Object is NOT defined!!!");
- return FALSE;
- }
+ cp_name = tcore_server_get_cp_name_by_plugin(plg);
+ if (cp_name == NULL) {
+ err("CP name is NULL");
+ return FALSE;
+ }
+
+ dbg("CP Name: [%s]", cp_name);
+ path = g_strdup_printf("%s/%s", MY_DBUS_PATH, cp_name);
- sat = telephony_object_peek_sat(TELEPHONY_OBJECT(object));
- telephony_sat_emit_end_proactive_session(sat, SAT_PROATV_CMD_TYPE_END_PROACTIVE_SESSION);
+ /* Look-up Hash table for Object */
+ object = g_hash_table_lookup(ctx->objects, path);
+ dbg("Path: [%s] Interface object: [%p]", path, object);
+ g_free(path);
+ if (object == NULL) {
+ err("Object is NOT defined!!!");
+ return FALSE;
}
- break;
- default:
- dbg("[SAT] cannot handle ui display status command(0x%x)", q_data.cmd_type);
- break;
+
+ sat = telephony_object_peek_sat(TELEPHONY_OBJECT(object));
+ telephony_sat_emit_end_proactive_session(sat, SAT_PROATV_CMD_TYPE_END_PROACTIVE_SESSION);
+ }
+ break;
+ default:
+ dbg("[SAT] cannot handle ui display status command(0x%x)", q_data.cmd_type);
+ break;
}
return result;
}
g_variant_get(download_data, "v", &data);
- if(g_evt_list[event_type] == TRUE){
+ if (g_evt_list[event_type] == TRUE) {
dbg("event (%d) shoud be passed to sim", event_type);
rv = TRUE;
}
- if(!rv){
+ if (!rv) {
dbg("(%d) event does not requested by sim", event_type);
return FALSE;
}
- switch(event_type)
- {
- case EVENT_USER_ACTIVITY:
- dbg("data type_format(%s)", g_variant_get_type_string(data));
- evt_download->device_identitie.src = src_dev;
- evt_download->device_identitie.dest = dest_dev;
- break;
- case EVENT_IDLE_SCREEN_AVAILABLE:
- dbg("data type_format(%s)", g_variant_get_type_string(data));
- g_variant_get(data, "(b)", &evt_download->idle_screen);
- evt_download->device_identitie.src = DEVICE_ID_DISPLAY;
- evt_download->device_identitie.dest = dest_dev;
- dbg("idle screen available (%d)", evt_download->idle_screen);
- break;
- case EVENT_LANGUAGE_SELECTION:
- dbg("data type_format(%s)", g_variant_get_type_string(data));
- g_variant_get(data, "(i)", &evt_download->language);
- evt_download->device_identitie.src = src_dev;
- evt_download->device_identitie.dest = dest_dev;
- dbg("selected language (%d)", evt_download->language);
- break;
- case EVENT_BROWSER_TERMINATION:{
- dbg("data type_format(%s)", g_variant_get_type_string(data));
- g_variant_get(data, "(i)", &evt_download->browser_termination);
- evt_download->device_identitie.src = src_dev;
- evt_download->device_identitie.dest = dest_dev;
- dbg("browser termination cause(%d)", evt_download->browser_termination);
- } break;
- case EVENT_DATA_AVAILABLE:{
- gint channel_id, channel_status, channel_info, channel_data_len;
-
- dbg("data type_format(%s)", g_variant_get_type_string(data));
- g_variant_get(data, "(iiii)", &channel_id, &channel_status, &channel_info, &channel_data_len);
- evt_download->device_identitie.src = src_dev;
- evt_download->device_identitie.dest = dest_dev;
- evt_download->channel_status.channel_id = channel_id;
- evt_download->channel_status.status = channel_status;
- evt_download->channel_status.status_info = channel_info;
- evt_download->channel_data_len.data_len = channel_data_len;
- dbg("data available channel id (%d)", evt_download->channel_status.channel_id);
- } break;
- case EVENT_CHANNEL_STATUS:{
- gint channel_id, channel_status, channel_info;
-
- dbg("data type_format(%s)", g_variant_get_type_string(data));
- g_variant_get(data, "(iii)", &channel_id, &channel_status, &channel_info);
- evt_download->device_identitie.src = src_dev;
- evt_download->device_identitie.dest = dest_dev;
- evt_download->channel_status.channel_id = channel_id;
- evt_download->channel_status.status = channel_status;
- evt_download->channel_status.status_info = channel_info;
-
- } break;
- default :
- dbg("not support download event (%d)", event_type);
- break;
+ switch (event_type) {
+ case EVENT_USER_ACTIVITY:
+ dbg("data type_format(%s)", g_variant_get_type_string(data));
+ evt_download->device_identitie.src = src_dev;
+ evt_download->device_identitie.dest = dest_dev;
+ break;
+ case EVENT_IDLE_SCREEN_AVAILABLE:
+ dbg("data type_format(%s)", g_variant_get_type_string(data));
+ g_variant_get(data, "(b)", &evt_download->idle_screen);
+ evt_download->device_identitie.src = DEVICE_ID_DISPLAY;
+ evt_download->device_identitie.dest = dest_dev;
+ dbg("idle screen available (%d)", evt_download->idle_screen);
+ break;
+ case EVENT_LANGUAGE_SELECTION:
+ dbg("data type_format(%s)", g_variant_get_type_string(data));
+ g_variant_get(data, "(i)", &evt_download->language);
+ evt_download->device_identitie.src = src_dev;
+ evt_download->device_identitie.dest = dest_dev;
+ dbg("selected language (%d)", evt_download->language);
+ break;
+ case EVENT_BROWSER_TERMINATION: {
+ dbg("data type_format(%s)", g_variant_get_type_string(data));
+ g_variant_get(data, "(i)", &evt_download->browser_termination);
+ evt_download->device_identitie.src = src_dev;
+ evt_download->device_identitie.dest = dest_dev;
+ dbg("browser termination cause(%d)", evt_download->browser_termination);
+ } break;
+ case EVENT_DATA_AVAILABLE: {
+ gint channel_id, channel_status, channel_info, channel_data_len;
+
+ dbg("data type_format(%s)", g_variant_get_type_string(data));
+ g_variant_get(data, "(iiii)", &channel_id, &channel_status, &channel_info, &channel_data_len);
+ evt_download->device_identitie.src = src_dev;
+ evt_download->device_identitie.dest = dest_dev;
+ evt_download->channel_status.channel_id = channel_id;
+ evt_download->channel_status.status = channel_status;
+ evt_download->channel_status.status_info = channel_info;
+ evt_download->channel_data_len.data_len = channel_data_len;
+ dbg("data available channel id (%d)", evt_download->channel_status.channel_id);
+ } break;
+ case EVENT_CHANNEL_STATUS: {
+ gint channel_id, channel_status, channel_info;
+
+ dbg("data type_format(%s)", g_variant_get_type_string(data));
+ g_variant_get(data, "(iii)", &channel_id, &channel_status, &channel_info);
+ evt_download->device_identitie.src = src_dev;
+ evt_download->device_identitie.dest = dest_dev;
+ evt_download->channel_status.channel_id = channel_id;
+ evt_download->channel_status.status = channel_status;
+ evt_download->channel_status.status_info = channel_info;
+ } break;
+ default:
+ dbg("not support download event (%d)", event_type);
+ break;
}
return TRUE;
strg = tcore_server_find_storage(s, "vconf");
plg = tcore_server_find_plugin(ctx->server, cp_name);
- if (!plg){
+ if (!plg) {
dbg("there is no valid plugin at this point");
return result;
}
return result;
}
- if(q_data.cmd_type != SAT_PROATV_CMD_LANGUAGE_NOTIFICATION){
+ if (q_data.cmd_type != SAT_PROATV_CMD_LANGUAGE_NOTIFICATION) {
dbg("[SAT] Language Noti dequeue failed. didn't find in command Q!!");
return result;
}
if (b_specified) {
lang_str = _convert_sim_lang_to_string((enum tel_sim_language_type)language);
- if(!lang_str){
+ if (!lang_str)
dbg("language is not exist");
- }
dbg("converted lang (%s)", lang_str);
- if(_sat_manager_check_language_set(lang_str)) {
+ if (_sat_manager_check_language_set(lang_str)) {
dbg("supprted language, set vconf.");
- result = tcore_storage_set_string(strg,STORAGE_KEY_LANGUAGE_SET, (const char*)lang_str);
- if(!result){
+ result = tcore_storage_set_string(strg, STORAGE_KEY_LANGUAGE_SET, (const char *)lang_str);
+ if (!result)
dbg("fail to update language");
- }
}
}
result = TRUE;
rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
+ if (rv != TCORE_RETURN_SUCCESS) {
dbg("fail to send terminal response");
g_free(tr);
result = FALSE;
#include <tcore.h>
#include <type/sat.h>
-#include "common.h"
+#include "dtapi_common.h"
typedef union {
struct tel_sat_display_text_tlv displayTextInd; /**< Parsed proactive command info from TLV to Telephony data type - display text */
--- /dev/null
+/*
+ * tel-plugin-dbus-tapi
+ *
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Ja-young Gu <jygu@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <glib.h>
+
+#include <tcore.h>
+#include <server.h>
+#include <plugin.h>
+#include <user_request.h>
+#include <co_sim.h>
+
+#include "generated-code.h"
+#include "dtapi_common.h"
+
+/*
+ * Error message to application (DBUS)
+ */
+#define DBUS_SIM_STATUS_ERROR "SIM STATUS ERROR"
+#define DBUS_SIM_NOT_FOUND "SIM NOT FOUND"
+#define DBUS_SIM_PERM_BLOCKED "SIM PERM BLOCKED"
+#define DBUS_SIM_CARD_ERROR "SIM CARD ERROR"
+#define DBUS_SIM_NOT_INITIALIZED "SIM NOT INITIALIZED"
+#define DBUS_SIM_INIT_COMPLETED "SIM INIT COMPLETED"
+#define DBUS_SIM_LOCKED "SIM LOCKED"
+#define DBUS_SIM_NOT_READY "SIM NOT READY"
+#define DBUS_SIM_RESPONSE_DATA_ERROR "SIM RESPONSE DATA ERROR"
+#define DBUS_SIM_SERVICE_IS_DISABLED "SIM SERVICE IS DISABLED"
+#define DBUS_SIM_SERVICE_NOT_SUPPORTED_FOR_NVSIM "SERVICE NOT SUPPORTED FOR NVSIM"
+
+#define DBUS_SIM_GET_COSIM(invocation, co_sim, server) do { \
+ co_sim = __get_sim_co_by_cp_name(server, GET_CP_NAME(invocation)); \
+ if (!co_sim) { \
+ err("[%s] SIM Core object is NULL", GET_CP_NAME(invocation)); \
+ FAIL_RESPONSE(invocation, DEFAULT_MSG_REQ_FAILED); \
+ return TRUE; \
+ } \
+} while (0)
+
+#define DBUS_SIM_CHECK_SIM_STATUS(invocation, op_type, co_sim) do { \
+ if (__check_sim_state(op_type, tcore_sim_get_status(co_sim)) == FALSE) { \
+ err("[%s] Invalid SIM status", GET_CP_NAME(invocation)); \
+ __return_fail_response(invocation, tcore_sim_get_status(co_sim)); \
+ return TRUE; \
+ } \
+} while (0)
+
+#define DBUS_SIM_CHECK_SIM_TYPE(co_sim, request) do { \
+ if (tcore_sim_get_type(co_sim) == SIM_TYPE_NVSIM) { \
+ err("[%s] is not supported for NVSIM", request); \
+ FAIL_RESPONSE(invocation, DBUS_SIM_SERVICE_NOT_SUPPORTED_FOR_NVSIM); \
+ return TRUE; \
+ } \
+} while (0)
+
+#define DBUS_SIM_CHECK_SIM_SERVICE_TABLE(invocation, op_type, co_sim) do { \
+ gboolean b_cphs = FALSE; \
+ b_cphs = tcore_sim_get_cphs_status(co_sim); \
+ if (b_cphs && op_type != GET_MSISDN) { \
+ dbg("[%s] CPHS SIM... Do not check SST", GET_CP_NAME(invocation)); \
+ } else { \
+ struct tel_sim_service_table* svct = tcore_sim_get_service_table(co_sim); \
+ if (svct != NULL) { \
+ if (__check_sim_service_table(op_type, svct) == FALSE) { \
+ err("[%s] 'Service' is disabled in SST", GET_CP_NAME(invocation)); \
+ FAIL_RESPONSE(invocation, DBUS_SIM_SERVICE_IS_DISABLED); \
+ free(svct); \
+ return TRUE; \
+ } else { \
+ dbg("[%s] Request to modem", GET_CP_NAME(invocation)); \
+ free(svct); \
+ } \
+ } \
+ } \
+} while (0)
+
+#define DBUS_SIM_CHECK_DISPATCH_RET(ret, invocation) do { \
+ if (ret != TCORE_RETURN_SUCCESS) { \
+ if (ret == TCORE_RETURN_SIM_DISABLED_IN_SST) { \
+ err("[%s] 'Service' is disabled in SST", GET_CP_NAME(invocation)); \
+ FAIL_RESPONSE(invocation, DBUS_SIM_SERVICE_IS_DISABLED); \
+ } else { \
+ err("[%s] Dispatch request failed: [0x%x]", GET_CP_NAME(invocation), ret); \
+ FAIL_RESPONSE(invocation, DEFAULT_MSG_REQ_FAILED); \
+ } \
+ } \
+} while (0)
+
+enum dbus_tapi_sim_gdbus_method_name {
+ /* EF Get */
+ GET_INIT_STATUS = 1,
+ GET_CARD_TYPE,
+ GET_IMSI,
+ GET_ECC,
+ GET_ICCID = 5,
+ GET_LANGUAGE,
+ SET_LANGUAGE,
+ GET_CALL_FORWARDING,
+ SET_CALL_FORWARDING,
+ GET_MESSAGE_WAITING = 10,
+ SET_MESSAGE_WAITING,
+ GET_MAILBOX,
+ SET_MAILBOX,
+ GET_CPHS_INFO,
+ GET_SVCT = 15,
+ GET_MSISDN,
+ GET_OPLMWACT,
+ GET_SPN,
+ GET_CPHS_NET_NAME,
+
+ /* Misc */
+ AUTHENTICATION = 20,
+ VERIFY_SEC,
+ VERIFY_PUK,
+ CHANGE_PIN,
+ DISABLE_FACILITY,
+ ENABLE_FACILITY = 25,
+ GET_FACILITY,
+ GET_LOCK_INFO,
+ TRANSFER_APDU,
+ GET_ATR,
+ GET_FIELDS = 30, /* for get various data at once */
+ GET_GID,
+ SET_POWERSTATE,
+ GET_IMPI,
+ GET_IMPU,
+ GET_DOMAIN = 35,
+ GET_PCSCF,
+ GET_APP_LIST,
+ GET_ISIM_SERVICE_TABLE,
+
+ /* Notification */
+ STATUS = 100,
+ REFRESHED,
+};
+
+static gboolean __is_sim_status_valid(enum tel_sim_status sim_status)
+{
+ switch (sim_status) {
+ case SIM_STATUS_INIT_COMPLETED:
+ case SIM_STATUS_INITIALIZING:
+ case SIM_STATUS_PIN_REQUIRED:
+ case SIM_STATUS_PUK_REQUIRED:
+ case SIM_STATUS_LOCK_REQUIRED:
+ case SIM_STATUS_CARD_BLOCKED:
+ case SIM_STATUS_NCK_REQUIRED:
+ case SIM_STATUS_NSCK_REQUIRED:
+ case SIM_STATUS_SPCK_REQUIRED:
+ case SIM_STATUS_CCK_REQUIRED:
+ return TRUE;
+ default:
+ return FALSE;
+ }
+}
+
+static CoreObject *__get_sim_co_by_cp_name(Server *server, char *cp_name)
+{
+ TcorePlugin *plugin;
+
+ if (!server) {
+ err("server is NULL");
+ return NULL;
+ }
+
+ plugin = tcore_server_find_plugin(server, cp_name);
+ return tcore_plugin_ref_core_object(plugin, CORE_OBJECT_TYPE_SIM);
+}
+
+static CoreObject* __get_sim_co_from_ur(Server *server, UserRequest *ur)
+{
+ CoreObject *co_sim;
+ char *modem_name;
+
+ modem_name = tcore_user_request_get_modem_name(ur);
+ if (!modem_name) {
+ err("Modem name is NULL");
+ return NULL;
+ }
+
+ co_sim = __get_sim_co_by_cp_name(server, modem_name);
+ free(modem_name);
+
+ return co_sim;
+}
+
+static gboolean __check_sim_state(enum dbus_tapi_sim_gdbus_method_name method,
+ enum tel_sim_status sim_status)
+{
+ gboolean ret = TRUE;
+
+ if ((int)sim_status < SIM_STATUS_CARD_ERROR) {
+ err("SIM status is NOT valid");
+ return FALSE;
+ }
+
+ switch (method) {
+ case GET_CARD_TYPE:
+ case GET_ECC:
+ case GET_ICCID:
+ case GET_LANGUAGE:
+ case GET_CPHS_INFO:
+ case GET_SPN:
+ case AUTHENTICATION:
+ case TRANSFER_APDU:
+ case GET_ATR:
+ /* Regarding Lock facilities */
+ case CHANGE_PIN:
+ case ENABLE_FACILITY:
+ case DISABLE_FACILITY:
+ case GET_FACILITY:
+ case GET_LOCK_INFO:
+ case VERIFY_SEC:
+ case VERIFY_PUK:
+ switch (sim_status) {
+ case SIM_STATUS_CARD_ERROR: /* FALLTHROUGH */
+ case SIM_STATUS_CARD_BLOCKED: /* FALLTHROUGH */
+ case SIM_STATUS_CARD_NOT_PRESENT: /* FALLTHROUGH */
+ case SIM_STATUS_CARD_REMOVED: /* FALLTHROUGH */
+ case SIM_STATUS_UNKNOWN: /* FALLTHROUGH */
+ case SIM_STATUS_CARD_POWEROFF:
+ ret = FALSE;
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ case GET_IMSI:
+ case GET_SVCT:
+ case GET_MSISDN:
+ case GET_OPLMWACT:
+ case GET_CPHS_NET_NAME:
+ case GET_CALL_FORWARDING:
+ case SET_CALL_FORWARDING:
+ case GET_MESSAGE_WAITING:
+ case SET_MESSAGE_WAITING:
+ case GET_MAILBOX:
+ case SET_MAILBOX:
+ case SET_LANGUAGE:
+ case GET_FIELDS:
+ case GET_IMPI:
+ case GET_IMPU:
+ case GET_GID:
+ case GET_DOMAIN:
+ case GET_PCSCF:
+ case GET_APP_LIST:
+ case GET_ISIM_SERVICE_TABLE:
+ if (sim_status != SIM_STATUS_INIT_COMPLETED)
+ ret = FALSE;
+ break;
+
+ case SET_POWERSTATE:
+ switch (sim_status) {
+ case SIM_STATUS_INIT_COMPLETED: /* FALLTHROUGH */
+ case SIM_STATUS_INITIALIZING: /* FALLTHROUGH */
+ case SIM_STATUS_PIN_REQUIRED: /* FALLTHROUGH */
+ case SIM_STATUS_CARD_BLOCKED: /* FALLTHROUGH */
+ case SIM_STATUS_CARD_POWEROFF:
+ break;
+
+ default:
+ ret = FALSE;
+ break;
+ }
+ break;
+
+ case GET_INIT_STATUS:
+ case STATUS:
+ case REFRESHED:
+ default:
+ err("Unhandled/Unknown operation: [%d]", method);
+ break;
+ }
+
+ return ret;
+}
+
+static gboolean __check_sim_service_table(enum dbus_tapi_sim_gdbus_method_name method,
+ struct tel_sim_service_table *svct)
+{
+ enum tel_sim_type sim_type = svct->sim_type;
+
+ gboolean ret = TRUE;
+
+ switch (method) {
+ case GET_MSISDN:
+ if (!(sim_type == SIM_TYPE_GSM && svct->table.sst.service[SIM_SST_MSISDN])
+ && !(sim_type == SIM_TYPE_USIM && svct->table.ust.service[SIM_UST_MSISDN]))
+ ret = FALSE;
+ break;
+
+ case GET_CALL_FORWARDING:
+ case SET_CALL_FORWARDING:
+ if (!(sim_type == SIM_TYPE_GSM && svct->table.sst.service[SIM_SST_CFIS])
+ && !(sim_type == SIM_TYPE_USIM && svct->table.ust.service[SIM_UST_CFIS]))
+ ret = FALSE;
+ break;
+
+ case GET_MESSAGE_WAITING:
+ case SET_MESSAGE_WAITING:
+ if (!(sim_type == SIM_TYPE_GSM && svct->table.sst.service[SIM_SST_MWIS])
+ && !(sim_type == SIM_TYPE_USIM && svct->table.ust.service[SIM_UST_MWIS]))
+ ret = FALSE;
+ break;
+
+ case GET_MAILBOX:
+ case SET_MAILBOX:
+ if (!(sim_type == SIM_TYPE_GSM && svct->table.sst.service[SIM_SST_MBDN]) &&
+ !(sim_type == SIM_TYPE_USIM && svct->table.ust.service[SIM_UST_MBDN]))
+ ret = FALSE;
+ break;
+
+ default:
+ err("Unhandled/Unknown operation: [%d]", method);
+ break;
+ }
+
+ return ret;
+}
+
+static void __return_fail_response(GDBusMethodInvocation *invocation,
+ enum tel_sim_status sim_status)
+{
+ dbg("[%s] SIM Status: [%d]", GET_CP_NAME(invocation), sim_status);
+
+ switch (sim_status) {
+ case SIM_STATUS_CARD_NOT_PRESENT:
+ case SIM_STATUS_CARD_REMOVED:
+ FAIL_RESPONSE(invocation, DBUS_SIM_NOT_FOUND);
+ break;
+
+ case SIM_STATUS_CARD_BLOCKED:
+ FAIL_RESPONSE(invocation, DBUS_SIM_PERM_BLOCKED);
+ break;
+
+ case SIM_STATUS_CARD_ERROR:
+ case SIM_STATUS_CARD_CRASHED:
+ FAIL_RESPONSE(invocation, DBUS_SIM_CARD_ERROR);
+ break;
+
+ case SIM_STATUS_INITIALIZING:
+ FAIL_RESPONSE(invocation, DBUS_SIM_NOT_INITIALIZED);
+ break;
+
+ case SIM_STATUS_INIT_COMPLETED:
+ FAIL_RESPONSE(invocation, DBUS_SIM_INIT_COMPLETED);
+ break;
+
+ case SIM_STATUS_PIN_REQUIRED:
+ case SIM_STATUS_PUK_REQUIRED:
+ case SIM_STATUS_NCK_REQUIRED:
+ case SIM_STATUS_NSCK_REQUIRED:
+ case SIM_STATUS_SPCK_REQUIRED:
+ case SIM_STATUS_CCK_REQUIRED:
+ case SIM_STATUS_LOCK_REQUIRED:
+ FAIL_RESPONSE(invocation, DBUS_SIM_LOCKED);
+ break;
+
+ case SIM_STATUS_UNKNOWN:
+ FAIL_RESPONSE(invocation, DBUS_SIM_NOT_READY);
+ break;
+
+ default:
+ dbg("Unhandled/Unknown status: [%d]", sim_status);
+ FAIL_RESPONSE(invocation, DBUS_SIM_STATUS_ERROR);
+ break;
+ }
+}
+
+static gboolean on_sim_get_init_status(TelephonySim *sim,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ enum tel_sim_status sim_status = SIM_STATUS_UNKNOWN;
+ gboolean sim_changed = FALSE;
+ CoreObject *co_sim = NULL;
+
+ if (!check_access_control(invocation, AC_SIM, "r"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+
+ sim_status = tcore_sim_get_status(co_sim);
+ sim_changed = tcore_sim_get_identification(co_sim);
+ dbg("[%s] SIM - Status: [%d] Changed: [%s]",
+ GET_CP_NAME(invocation),
+ sim_status, (sim_changed ? "YES" : "NO"));
+
+ telephony_sim_complete_get_init_status(sim,
+ invocation, sim_status, sim_changed);
+
+ return TRUE;
+}
+
+static gboolean on_sim_get_card_type(TelephonySim *sim,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ enum tel_sim_type sim_type = SIM_TYPE_UNKNOWN;
+ CoreObject *co_sim = NULL;
+
+ if (!check_access_control(invocation, AC_SIM, "r"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, GET_CARD_TYPE, co_sim);
+
+ sim_type = tcore_sim_get_type(co_sim);
+ dbg("[%s] SIM Card type: [%s]", GET_CP_NAME(invocation),
+ (sim_type == SIM_TYPE_GSM ? "GSM" :
+ (sim_type == SIM_TYPE_USIM ? "USIM" :
+ (sim_type == SIM_TYPE_RUIM ? "RUIM" :
+ (sim_type == SIM_TYPE_NVSIM ? "NVSIM" :
+ (sim_type == SIM_TYPE_ISIM ? "ISIM" :
+ "UNKNOWN"))))));
+
+ telephony_sim_complete_get_card_type(sim,
+ invocation, sim_type);
+
+ return TRUE;
+}
+
+static gboolean on_sim_get_imsi(TelephonySim *sim,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ struct tel_sim_imsi *imsi;
+ CoreObject *co_sim = NULL;
+
+ if (!check_access_control(invocation, AC_SIM, "r"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, GET_IMSI, co_sim);
+
+ imsi = tcore_sim_get_imsi(co_sim);
+ if (!imsi) {
+ FAIL_RESPONSE(invocation, DBUS_SIM_RESPONSE_DATA_ERROR);
+ } else {
+ dbg("[%s] IMSI - PLMN: [%s] MSIN: [%s]", GET_CP_NAME(invocation),
+ imsi->plmn, imsi->msin);
+
+ telephony_sim_complete_get_imsi(sim,
+ invocation, imsi->plmn, imsi->msin);
+
+ g_free(imsi);
+ }
+
+ return TRUE;
+}
+
+static gboolean on_sim_get_ecc(TelephonySim *sim,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ CoreObject *co_sim = NULL;
+ struct tel_sim_ecc_list *ecc_list = NULL;
+
+ if (!check_access_control(invocation, AC_SIM, "r"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, GET_ECC, co_sim);
+ DBUS_SIM_CHECK_SIM_TYPE(co_sim, "Get ECC");
+
+ ecc_list = tcore_sim_get_ecc_list(co_sim);
+ if (!ecc_list) {
+ struct custom_data *ctx = user_data;
+
+ dbg("[%s] ECC list is NULL - Request to Modem.", GET_CP_NAME(invocation));
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sim, invocation,
+ TREQ_SIM_GET_ECC,
+ NULL, 0);
+ } else {
+ GVariant *gv = NULL;
+ GVariantBuilder b;
+ int i;
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+ for (i = 0; i < ecc_list->ecc_count; i++) {
+ dbg("[%s] ECC[%d] - Category: [0x%x] Number: [%s] String: [%s]",
+ GET_CP_NAME(invocation), i,
+ ecc_list->ecc[i].ecc_category,
+ ecc_list->ecc[i].ecc_num,
+ ecc_list->ecc[i].ecc_string);
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "category",
+ g_variant_new_int32(ecc_list->ecc[i].ecc_category));
+ g_variant_builder_add(&b, "{sv}", "number",
+ g_variant_new_string(ecc_list->ecc[i].ecc_num));
+ g_variant_builder_add(&b, "{sv}", "name",
+ g_variant_new_string(ecc_list->ecc[i].ecc_string));
+ g_variant_builder_close(&b);
+ }
+ gv = g_variant_builder_end(&b);
+ if (!gv)
+ err("ecc gv is NULL");
+
+ telephony_sim_complete_get_ecc(sim,
+ invocation, gv);
+
+ g_free(ecc_list);
+ }
+
+ return TRUE;
+}
+
+static gboolean on_sim_get_iccid(TelephonySim *sim,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ CoreObject *co_sim = NULL;
+ struct tel_sim_iccid* iccid = NULL;
+
+ if (!check_access_control(invocation, AC_SIM, "r"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, GET_ICCID, co_sim);
+ DBUS_SIM_CHECK_SIM_TYPE(co_sim, "Get ICCID");
+
+ iccid = tcore_sim_get_iccid(co_sim);
+ if (!iccid) {
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sim, invocation,
+ TREQ_SIM_GET_ICCID,
+ NULL, 0);
+ } else {
+ dbg("[%s] ICCID: [%s]", GET_CP_NAME(invocation),
+ iccid->iccid);
+
+ telephony_sim_complete_get_iccid(sim,
+ invocation, SIM_ACCESS_SUCCESS, iccid->iccid);
+
+ g_free(iccid);
+ }
+
+ return TRUE;
+}
+
+static gboolean on_sim_get_language(TelephonySim *sim,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ CoreObject *co_sim = NULL;
+
+ if (!check_access_control(invocation, AC_SIM, "r"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, GET_LANGUAGE, co_sim);
+ DBUS_SIM_CHECK_SIM_TYPE(co_sim, "Get Language");
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sim, invocation,
+ TREQ_SIM_GET_LANGUAGE,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_sim_set_language(TelephonySim *sim,
+ GDBusMethodInvocation *invocation, gint language, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ CoreObject *co_sim = NULL;
+ struct treq_sim_set_language req;
+
+ if (!check_access_control(invocation, AC_SIM, "w"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, SET_LANGUAGE, co_sim);
+ DBUS_SIM_CHECK_SIM_TYPE(co_sim, "Set Language");
+
+ memset(&req, 0x0, sizeof(struct treq_sim_set_language));
+
+ req.language = language;
+
+ dbg("[%s] Language: [0x%02x]", GET_CP_NAME(invocation),
+ req.language);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sim, invocation,
+ TREQ_SIM_SET_LANGUAGE,
+ &req, sizeof(struct treq_sim_set_language));
+
+ return TRUE;
+}
+
+static gboolean on_sim_get_call_forwarding(TelephonySim *sim,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ CoreObject *co_sim = NULL;
+ TReturn ret;
+
+ if (!check_access_control(invocation, AC_SIM, "r"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, GET_CALL_FORWARDING, co_sim);
+ DBUS_SIM_CHECK_SIM_TYPE(co_sim, "Get Call Forwarding");
+ DBUS_SIM_CHECK_SIM_SERVICE_TABLE(invocation, GET_CALL_FORWARDING, co_sim);
+
+ /* Dispatch request */
+ ret = dtapi_dispatch_request_ex(ctx, sim, invocation,
+ TREQ_SIM_GET_CALLFORWARDING,
+ NULL, 0);
+ DBUS_SIM_CHECK_DISPATCH_RET(ret, invocation);
+
+ return TRUE;
+}
+
+static gboolean on_sim_set_call_forwarding(TelephonySim *sim,
+ GDBusMethodInvocation *invocation,
+ gboolean cphs,
+ gint rec_index,
+ gint msp_num,
+ guchar cfu_status,
+ gint ton, gint npi, const gchar *number,
+ gint cc2_id, gint ext7_id,
+ gboolean cphs_line1, gboolean cphs_line2,
+ gboolean cphs_fax, gboolean cphs_data, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ CoreObject *co_sim = NULL;
+ struct treq_sim_set_callforwarding req;
+ TReturn ret;
+
+ if (!check_access_control(invocation, AC_SIM, "w"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, SET_CALL_FORWARDING, co_sim);
+ DBUS_SIM_CHECK_SIM_TYPE(co_sim, "Set Call Forwarding");
+ DBUS_SIM_CHECK_SIM_SERVICE_TABLE(invocation, SET_CALL_FORWARDING, co_sim);
+
+ memset(&req, 0x0, sizeof(struct treq_sim_set_callforwarding));
+
+ req.b_cphs = cphs;
+ if (req.b_cphs) {
+ req.cphs_cf.b_line1 = cphs_line1;
+ req.cphs_cf.b_line2 = cphs_line2;
+ req.cphs_cf.b_fax = cphs_fax;
+ req.cphs_cf.b_data = cphs_data;
+
+ dbg("[%s] b_line1: [%d] b_line2: [%d] b_fax: [%d] b_data: [%d]",
+ GET_CP_NAME(invocation),
+ req.cphs_cf.b_line1, req.cphs_cf.b_line2,
+ req.cphs_cf.b_fax, req.cphs_cf.b_data);
+ } else {
+ req.cf.rec_index = rec_index;
+ req.cf.msp_num = msp_num;
+ req.cf.cfu_status = cfu_status;
+ req.cf.ton = ton;
+ req.cf.npi = npi;
+ memcpy(&req.cf.cfu_num, number, strlen(number));
+ req.cf.cc2_id = cc2_id;
+ req.cf.ext7_id = ext7_id;
+
+ dbg("[%s] rec_index: [%d] msp_num: [%d] cfu_status: [0x%x] " \
+ "ton: [%d] npi: [%d] cfu_num: [%s] cc2_id: [%d] ext7_id: [%d]",
+ GET_CP_NAME(invocation), req.cf.rec_index,
+ req.cf.msp_num, req.cf.cfu_status, req.cf.ton,
+ req.cf.npi, req.cf.cfu_num, req.cf.cc2_id, req.cf.ext7_id);
+ }
+
+ /* Dispatch request */
+ ret = dtapi_dispatch_request_ex(ctx, sim, invocation,
+ TREQ_SIM_SET_CALLFORWARDING,
+ &req, sizeof(struct treq_sim_set_callforwarding));
+ DBUS_SIM_CHECK_DISPATCH_RET(ret, invocation);
+
+ return TRUE;
+}
+
+static gboolean on_sim_get_message_waiting(TelephonySim *sim,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ CoreObject *co_sim = NULL;
+ TReturn ret;
+
+ if (!check_access_control(invocation, AC_SIM, "r"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, GET_MESSAGE_WAITING, co_sim);
+ DBUS_SIM_CHECK_SIM_TYPE(co_sim, "Get Message Waiting");
+ DBUS_SIM_CHECK_SIM_SERVICE_TABLE(invocation, GET_MESSAGE_WAITING, co_sim);
+
+ /* Dispatch request */
+ ret = dtapi_dispatch_request_ex(ctx, sim, invocation,
+ TREQ_SIM_GET_MESSAGEWAITING,
+ NULL, 0);
+ DBUS_SIM_CHECK_DISPATCH_RET(ret, invocation);
+
+ return TRUE;
+}
+
+static gboolean on_sim_set_message_waiting(TelephonySim *sim,
+ GDBusMethodInvocation *invocation,
+ gboolean cphs,
+ gint rec_index,
+ guchar indicator_status,
+ gint voice_cnt, gint fax_cnt,
+ gint email_cnt, gint other_cnt,
+ gint video_cnt,
+ gboolean cphs_voice1, gboolean cphs_voice2,
+ gboolean cphs_fax, gboolean cphs_data, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ TReturn ret;
+ CoreObject *co_sim = NULL;
+ struct treq_sim_set_messagewaiting req;
+
+ if (!check_access_control(invocation, AC_SIM, "w"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, SET_MESSAGE_WAITING, co_sim);
+ DBUS_SIM_CHECK_SIM_TYPE(co_sim, "Set Message Waiting");
+ DBUS_SIM_CHECK_SIM_SERVICE_TABLE(invocation, SET_MESSAGE_WAITING, co_sim);
+
+ memset(&req, 0x0, sizeof(struct treq_sim_set_messagewaiting));
+
+ req.b_cphs = cphs;
+
+ if (req.b_cphs) {
+ req.cphs_mw.b_voice1 = cphs_voice1;
+ req.cphs_mw.b_voice2 = cphs_voice2;
+ req.cphs_mw.b_fax = cphs_fax;
+ req.cphs_mw.b_data = cphs_data;
+
+ dbg("[%s] b_voice1: [%d] b_voice2: [%d] b_fax: [%d] b_data:[%d]",
+ GET_CP_NAME(invocation),
+ req.cphs_mw.b_voice1, req.cphs_mw.b_voice2,
+ req.cphs_mw.b_fax, req.cphs_mw.b_data);
+ } else {
+ req.mw.rec_index = rec_index;
+ req.mw.indicator_status = indicator_status;
+ req.mw.voice_count = voice_cnt;
+ req.mw.fax_count = fax_cnt;
+ req.mw.email_count = email_cnt;
+ req.mw.other_count = other_cnt;
+ req.mw.video_count = video_cnt;
+
+ dbg("[%s] rec_index: [%d] indicator_status: [0x%x] voice_count: [%d] " \
+ "fax_count: [%d] email_count: [%d] other_count: [%d] video_count: [%d]",
+ GET_CP_NAME(invocation),
+ req.mw.rec_index, req.mw.indicator_status,
+ req.mw.voice_count, req.mw.fax_count,
+ req.mw.email_count, req.mw.other_count,
+ req.mw.video_count);
+ }
+
+ /* Dispatch request */
+ ret = dtapi_dispatch_request_ex(ctx, sim, invocation,
+ TREQ_SIM_SET_MESSAGEWAITING,
+ &req, sizeof(struct treq_sim_set_messagewaiting));
+ DBUS_SIM_CHECK_DISPATCH_RET(ret, invocation);
+
+ return TRUE;
+}
+
+static gboolean on_sim_get_mailbox(TelephonySim *sim,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ TReturn ret;
+ CoreObject *co_sim = NULL;
+
+ if (!check_access_control(invocation, AC_SIM, "r"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, GET_MAILBOX, co_sim);
+ DBUS_SIM_CHECK_SIM_TYPE(co_sim, "Get Mailbox");
+ DBUS_SIM_CHECK_SIM_SERVICE_TABLE(invocation, GET_MAILBOX, co_sim);
+
+ /* Dispatch request */
+ ret = dtapi_dispatch_request_ex(ctx, sim, invocation,
+ TREQ_SIM_GET_MAILBOX,
+ NULL, 0);
+ DBUS_SIM_CHECK_DISPATCH_RET(ret, invocation);
+
+ return TRUE;
+}
+
+static gboolean on_sim_set_mailbox(TelephonySim *sim,
+ GDBusMethodInvocation *invocation,
+ gboolean cphs,
+ gint mb_type, gint rec_index,
+ gint profile_number,
+ gint alpha_id_max_len, const gchar *alpha_id,
+ gint ton, gint npi, const gchar *number,
+ gint cc_id, gint ext1_id, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ TReturn ret;
+ CoreObject *co_sim = NULL;
+ struct treq_sim_set_mailbox req;
+
+ if (!check_access_control(invocation, AC_SIM, "w"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, SET_MAILBOX, co_sim);
+ DBUS_SIM_CHECK_SIM_TYPE(co_sim, "Set Mailbox");
+ DBUS_SIM_CHECK_SIM_SERVICE_TABLE(invocation, SET_MAILBOX, co_sim);
+
+ memset(&req, 0x0, sizeof(struct treq_sim_set_mailbox));
+
+ req.b_cphs = cphs;
+
+ req.mb_info.mb_type = mb_type;
+ req.mb_info.rec_index = rec_index;
+ req.mb_info.profile_number = profile_number;
+ req.mb_info.number_info.alpha_id_max_len = alpha_id_max_len;
+ if (strlen(alpha_id))
+ memcpy(&req.mb_info.number_info.alpha_id, alpha_id, strlen(alpha_id));
+ req.mb_info.number_info.ton = ton;
+ req.mb_info.number_info.npi = npi;
+ if (strlen(number))
+ memcpy(&req.mb_info.number_info.num, number, strlen(number));
+ req.mb_info.number_info.cc_id = cc_id;
+ req.mb_info.number_info.ext1_id = ext1_id;
+
+ dbg("[%s] b_cphs: [%d] mb_type: [%d] rec_index: [%d] " \
+ "profile_number: [%d] alpha_id_max_len: [%d] alpha_id: [%s] " \
+ "ton: [%d] npi: [%d] num: [%s] cc_id: [%d] ext1_id: [%d]",
+ GET_CP_NAME(invocation),
+ req.b_cphs,
+ req.mb_info.mb_type, req.mb_info.rec_index,
+ req.mb_info.profile_number,
+ req.mb_info.number_info.alpha_id_max_len,
+ req.mb_info.number_info.alpha_id,
+ req.mb_info.number_info.ton, req.mb_info.number_info.npi,
+ req.mb_info.number_info.num,
+ req.mb_info.number_info.cc_id, req.mb_info.number_info.ext1_id);
+
+ /* Dispatch request */
+ ret = dtapi_dispatch_request_ex(ctx, sim, invocation,
+ TREQ_SIM_SET_MAILBOX,
+ &req, sizeof(struct treq_sim_set_mailbox));
+ DBUS_SIM_CHECK_DISPATCH_RET(ret, invocation);
+
+ return TRUE;
+}
+
+static gboolean on_sim_get_cphsinfo(TelephonySim *sim,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ CoreObject *co_sim = NULL;
+
+ if (!check_access_control(invocation, AC_SIM, "r"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, GET_CPHS_INFO, co_sim);
+ DBUS_SIM_CHECK_SIM_TYPE(co_sim, "Get CPHS Info");
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sim, invocation,
+ TREQ_SIM_GET_CPHS_INFO,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_sim_get_service_table(TelephonySim *sim,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ CoreObject *co_sim = NULL;
+ struct tel_sim_service_table *svct = NULL;
+
+ if (!check_access_control(invocation, AC_SIM, "r"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, GET_SVCT, co_sim);
+ DBUS_SIM_CHECK_SIM_TYPE(co_sim, "Get SVCT");
+
+ svct = tcore_sim_get_service_table(co_sim);
+ if (!svct) {
+ struct custom_data *ctx = user_data;
+
+ dbg("[%s] NOT cached - Request to modem",
+ GET_CP_NAME(invocation));
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sim, invocation,
+ TREQ_SIM_GET_SERVICE_TABLE,
+ NULL, 0);
+ } else {
+ GVariantBuilder builder;
+ GVariant * inner_gv = NULL;
+ GVariant *svct_gv = NULL;
+ int i = 0;
+
+ dbg("[%s] GET_SERVICE_TABLE", GET_CP_NAME(invocation));
+
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("ay"));
+ if (svct->sim_type == SIM_TYPE_GSM) {
+ for (i = 0; i < SIM_SST_SERVICE_CNT_MAX; i++)
+ g_variant_builder_add(&builder, "y",
+ svct->table.sst.service[i]);
+ } else if (svct->sim_type == SIM_TYPE_USIM) {
+ for (i = 0; i < SIM_UST_SERVICE_CNT_MAX; i++)
+ g_variant_builder_add(&builder, "y",
+ svct->table.ust.service[i]);
+ } else if (svct->sim_type == SIM_TYPE_RUIM) {
+ if (SIM_CDMA_SVC_TABLE == svct->table.cst.cdma_svc_table) {
+ for (i = 0; i < SIM_CDMA_ST_SERVICE_CNT_MAX; i++)
+ g_variant_builder_add(&builder, "iy",
+ svct->table.cst.cdma_svc_table,
+ svct->table.cst.service.cdma_service[i]);
+ } else if (SIM_CSIM_SVC_TABLE == svct->table.cst.cdma_svc_table) {
+ for (i = 0; i < SIM_CSIM_ST_SERVICE_CNT_MAX; i++)
+ g_variant_builder_add(&builder, "iy",
+ svct->table.cst.cdma_svc_table,
+ svct->table.cst.service.csim_service[i]);
+ } else {
+ err("Invalid cdma_svc_table: [%d]", svct->table.cst.cdma_svc_table);
+ }
+ } else {
+ err("[%s] Unknown SIM type: [%d]", GET_CP_NAME(invocation), svct->sim_type);
+ }
+ inner_gv = g_variant_builder_end(&builder);
+ svct_gv = g_variant_new("v", inner_gv);
+
+ telephony_sim_complete_get_service_table(sim,
+ invocation, SIM_ACCESS_SUCCESS, svct->sim_type, svct_gv);
+
+ free(svct);
+ }
+
+ return TRUE;
+}
+
+static gboolean on_sim_get_msisdn(TelephonySim *sim,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ CoreObject *co_sim = NULL;
+ struct tel_sim_msisdn_list *msisdn_list = NULL;
+ gboolean read_from_modem = FALSE;
+
+ if (!check_access_control(invocation, AC_SIM, "r"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, GET_MSISDN, co_sim);
+ DBUS_SIM_CHECK_SIM_SERVICE_TABLE(invocation, GET_MSISDN, co_sim);
+
+ if (SIM_TYPE_NVSIM == tcore_sim_get_type(co_sim)) {
+ dbg("NV SIM, don't use cached MSISDN");
+ read_from_modem = TRUE;
+ } else {
+ msisdn_list = tcore_sim_get_msisdn_list(co_sim);
+ if (msisdn_list)
+ read_from_modem = FALSE;
+ else
+ read_from_modem = TRUE;
+ }
+
+ if (read_from_modem) {
+ TReturn ret;
+
+ dbg("[%s] NOT cached - Request to modem", GET_CP_NAME(invocation));
+
+ /* Dispatch request */
+ ret = dtapi_dispatch_request_ex(ctx, sim, invocation,
+ TREQ_SIM_GET_MSISDN,
+ NULL, 0);
+ DBUS_SIM_CHECK_DISPATCH_RET(ret, invocation);
+ } else {
+ GVariant *gv = NULL;
+ int i;
+ GVariantBuilder b;
+
+ dbg("[%s] MSISDN count: [%d]",
+ GET_CP_NAME(invocation), msisdn_list->count);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+ for (i = 0; i < msisdn_list->count; i++) {
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "name",
+ g_variant_new_string((const gchar *)msisdn_list->msisdn[i].name));
+ if (msisdn_list->msisdn[i].ton == SIM_TON_INTERNATIONAL) {
+ unsigned char *tmp = (unsigned char *)calloc(SIM_MSISDN_NUMBER_LEN_MAX + 1, 1);
+ if (tmp != NULL) {
+ tmp[0] = '+';
+
+ strncpy((char *)tmp+1,
+ (const char*)msisdn_list->msisdn[i].num,
+ SIM_MSISDN_NUMBER_LEN_MAX - 1);
+ tmp[SIM_MSISDN_NUMBER_LEN_MAX] = '\0';
+
+ g_variant_builder_add(&b, "{sv}", "number",
+ g_variant_new_string((const gchar *)tmp));
+
+ free(tmp);
+ } else {
+ warn("Memory allocation failed");
+ g_variant_builder_add(&b, "{sv}", "number",
+ g_variant_new_string((const gchar *)msisdn_list->msisdn[i].num));
+ }
+ } else {
+ g_variant_builder_add(&b, "{sv}", "number",
+ g_variant_new_string((const gchar *)msisdn_list->msisdn[i].num));
+ }
+ g_variant_builder_close(&b);
+ }
+ gv = g_variant_builder_end(&b);
+
+ telephony_sim_complete_get_msisdn(sim,
+ invocation, SIM_ACCESS_SUCCESS, gv);
+
+ g_free(msisdn_list);
+ }
+
+ return TRUE;
+}
+
+static gboolean on_sim_get_oplmnwact(TelephonySim *sim,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ CoreObject *co_sim = NULL;
+
+ if (!check_access_control(invocation, AC_SIM, "r"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, GET_OPLMWACT, co_sim);
+ DBUS_SIM_CHECK_SIM_TYPE(co_sim, "Get OPLMNWACT");
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sim, invocation,
+ TREQ_SIM_GET_OPLMNWACT,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_sim_get_spn(TelephonySim *sim,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ CoreObject *co_sim = NULL;
+ struct tel_sim_spn* spn = NULL;
+
+ if (!check_access_control(invocation, AC_SIM, "r"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, GET_SPN, co_sim);
+ DBUS_SIM_CHECK_SIM_TYPE(co_sim, "Get SPN");
+
+ spn = tcore_sim_get_spn(co_sim);
+ if (!spn) {
+ dbg("[%s] NOT cached - Request to modem", GET_CP_NAME(invocation));
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sim, invocation,
+ TREQ_SIM_GET_SPN,
+ NULL, 0);
+ } else {
+ dbg("[%s] Display condition: [%d] SPN: [%s]",
+ GET_CP_NAME(invocation),
+ spn->display_condition, (const gchar *)spn->spn);
+
+ telephony_sim_complete_get_spn(sim, invocation, SIM_ACCESS_SUCCESS,
+ spn->display_condition, (const gchar *)spn->spn);
+
+ g_free(spn);
+ }
+ return TRUE;
+}
+
+static gboolean on_sim_get_cphs_netname(TelephonySim *sim,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ CoreObject *co_sim = NULL;
+ struct tel_sim_cphs_netname *cphs_netname = NULL;
+
+ if (!check_access_control(invocation, AC_SIM, "r"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, GET_CPHS_NET_NAME, co_sim);
+ DBUS_SIM_CHECK_SIM_TYPE(co_sim, "Get CPHS Net Name");
+
+ cphs_netname = tcore_sim_get_cphs_netname(co_sim);
+ if (!cphs_netname) {
+ dbg("[%s] NOT cached - Request to modem", GET_CP_NAME(invocation));
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sim, invocation,
+ TREQ_SIM_GET_CPHS_NETNAME,
+ NULL, 0);
+ } else {
+ dbg("[%s] Full name: [%s] Short name: [%s]",
+ GET_CP_NAME(invocation),
+ (const gchar *)cphs_netname->full_name,
+ (const gchar *)cphs_netname->short_name);
+
+ telephony_sim_complete_get_cphs_net_name(sim,
+ invocation, SIM_ACCESS_SUCCESS,
+ (const gchar *)cphs_netname->full_name,
+ (const gchar *)cphs_netname->short_name);
+
+ g_free(cphs_netname);
+ }
+
+ return TRUE;
+}
+
+static gboolean on_sim_get_gid(TelephonySim *sim,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ CoreObject *co_sim = NULL;
+
+ if (!check_access_control(invocation, AC_SIM, "r"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, GET_GID, co_sim);
+ DBUS_SIM_CHECK_SIM_TYPE(co_sim, "Get GID");
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sim, invocation,
+ TREQ_SIM_GET_GID,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_sim_authentication(TelephonySim *sim,
+ GDBusMethodInvocation *invocation, gint auth_type,
+ GVariant *rand, GVariant *autn, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ GVariantIter *iter = NULL;
+ GVariant *rand_gv = NULL;
+ GVariant *autn_gv = NULL;
+ guchar rt_i;
+ int i = 0;
+ TReturn ret;
+ CoreObject *co_sim = NULL;
+ struct treq_sim_req_authentication req;
+
+ if (!check_access_control(invocation, AC_SIM, "x"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, AUTHENTICATION, co_sim);
+
+ memset(&req, 0x0, sizeof(struct treq_sim_req_authentication));
+
+ req.auth_type = auth_type;
+
+ rand_gv = g_variant_get_variant(rand);
+ g_variant_get(rand_gv, "ay", &iter);
+ while (g_variant_iter_loop(iter, "y", &rt_i)) {
+ req.rand_data[i] = rt_i;
+ i++;
+ }
+ g_variant_iter_free(iter);
+ g_variant_unref(rand_gv);
+
+ req.rand_length = (unsigned int)i;
+
+ i = 0;
+ autn_gv = g_variant_get_variant(autn);
+ g_variant_get(autn_gv, "ay", &iter);
+ while (g_variant_iter_loop(iter, "y", &rt_i)) {
+ req.autn_data[i] = rt_i;
+ i++;
+ }
+ g_variant_iter_free(iter);
+ g_variant_unref(autn_gv);
+
+ req.autn_length = (unsigned int)i;
+
+ dbg("[%s] Authentication - type: [0x%02x] RAND len: [%d] AUTN len: [%d]",
+ GET_CP_NAME(invocation),
+ req.auth_type, req.rand_length, req.autn_length);
+
+ /* Dispatch request */
+ ret = dtapi_dispatch_request_ex(ctx, sim, invocation,
+ TREQ_SIM_REQ_AUTHENTICATION,
+ &req, sizeof(struct treq_sim_req_authentication));
+ if (ret != TCORE_RETURN_SUCCESS) {
+ GVariantBuilder builder;
+ GVariant *ak = NULL;
+ GVariant *cp = NULL;
+ GVariant *it = NULL;
+ GVariant *resp = NULL;
+ GVariant *ak_gv = NULL;
+ GVariant *cp_gv = NULL;
+ GVariant *it_gv = NULL;
+ GVariant *resp_gv = NULL;
+
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("ay"));
+ ak = g_variant_builder_end(&builder);
+ ak_gv = g_variant_new("v", ak);
+
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("ay"));
+ cp = g_variant_builder_end(&builder);
+ cp_gv = g_variant_new("v", cp);
+
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("ay"));
+ it = g_variant_builder_end(&builder);
+ it_gv = g_variant_new("v", it);
+
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("ay"));
+ resp = g_variant_builder_end(&builder);
+ resp_gv = g_variant_new("v", resp);
+
+ telephony_sim_complete_authentication(sim,
+ invocation, SIM_ACCESS_FAILED,
+ 0, 0, ak_gv, cp_gv, it_gv, resp_gv);
+ }
+
+ return TRUE;
+}
+
+static gboolean on_sim_verify_sec(TelephonySim *sim,
+ GDBusMethodInvocation *invocation,
+ gint pin_type, const gchar *pin, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ CoreObject *co_sim = NULL;
+ struct treq_sim_verify_pins req;
+
+ if (!check_access_control(invocation, AC_SIM, "x"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, VERIFY_SEC, co_sim);
+ DBUS_SIM_CHECK_SIM_TYPE(co_sim, "Verify Sec");
+
+ memset(&req, 0x0, sizeof(struct treq_sim_verify_pins));
+
+ req.pin_type = pin_type;
+ req.pin_length = strlen(pin);
+ memcpy(req.pin, pin, req.pin_length);
+
+ dbg("[%s] PIN - type: [0x%02x] len: [%d]",
+ GET_CP_NAME(invocation),
+ req.pin_type, req.pin_length);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sim, invocation,
+ TREQ_SIM_VERIFY_PINS,
+ &req, sizeof(struct treq_sim_verify_pins));
+
+ return TRUE;
+}
+
+static gboolean on_sim_verify_puk(TelephonySim *sim,
+ GDBusMethodInvocation *invocation,
+ gint puk_type, const gchar *puk,
+ const gchar *new_pin, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ CoreObject *co_sim = NULL;
+ struct treq_sim_verify_puks req;
+
+ if (!check_access_control(invocation, AC_SIM, "x"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, VERIFY_PUK, co_sim);
+ DBUS_SIM_CHECK_SIM_TYPE(co_sim, "Verify PUK");
+
+ memset(&req, 0x0, sizeof(struct treq_sim_verify_puks));
+
+ req.puk_type = puk_type;
+ req.puk_length = strlen(puk);
+ memcpy(req.puk, puk, req.puk_length);
+ req.pin_length = strlen(new_pin);
+ memcpy(req.pin, new_pin, req.pin_length);
+
+ dbg("[%s] PUK - type: [0x%02x] len: [%d] PIN len: [%d]",
+ GET_CP_NAME(invocation), req.puk_type,
+ req.puk_length, req.pin_length);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sim, invocation,
+ TREQ_SIM_VERIFY_PUKS,
+ &req, sizeof(struct treq_sim_verify_puks));
+
+ return TRUE;
+}
+
+static gboolean on_sim_change_pin(TelephonySim *sim,
+ GDBusMethodInvocation *invocation,
+ gint pin_type, const gchar *old_pin, const gchar *new_pin,
+ gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ CoreObject *co_sim = NULL;
+ struct treq_sim_change_pins req;
+
+ if (!check_access_control(invocation, AC_SIM, "x"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, CHANGE_PIN, co_sim);
+ DBUS_SIM_CHECK_SIM_TYPE(co_sim, "Change PIN");
+
+ memset(&req, 0x0, sizeof(struct treq_sim_change_pins));
+
+ req.type = pin_type;
+ req.old_pin_length = strlen(old_pin);
+ memcpy(req.old_pin, old_pin, req.old_pin_length);
+ req.new_pin_length = strlen(new_pin);
+ memcpy(req.new_pin, new_pin, req.new_pin_length);
+
+ dbg("[%s] PIN - type: [0x%02x] Old PIN len: [%d] New PIN len: [%d]",
+ GET_CP_NAME(invocation), req.type,
+ req.old_pin_length, req.new_pin_length);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sim, invocation,
+ TREQ_SIM_CHANGE_PINS,
+ &req, sizeof(struct treq_sim_change_pins));
+
+ return TRUE;
+}
+
+static gboolean on_sim_disable_facility(TelephonySim *sim,
+ GDBusMethodInvocation *invocation,
+ gint facility_type, const gchar *password, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ struct treq_sim_disable_facility req;
+ CoreObject *co_sim = NULL;
+
+ if (!check_access_control(invocation, AC_SIM, "x"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, DISABLE_FACILITY, co_sim);
+ DBUS_SIM_CHECK_SIM_TYPE(co_sim, "Diable Facility");
+
+ memset(&req, 0x0, sizeof(struct treq_sim_disable_facility));
+
+ dbg("[%s] facility_type: [%d]", GET_CP_NAME(invocation), facility_type);
+ switch (facility_type) {
+ case 1:
+ req.type = SIM_FACILITY_PS;
+ break;
+
+ case 3:
+ req.type = SIM_FACILITY_SC;
+ break;
+
+ case 4:
+ req.type = SIM_FACILITY_FD;
+ break;
+
+ case 5:
+ req.type = SIM_FACILITY_PN;
+ break;
+
+ case 6:
+ req.type = SIM_FACILITY_PU;
+ break;
+
+ case 7:
+ req.type = SIM_FACILITY_PP;
+ break;
+
+ case 8:
+ req.type = SIM_FACILITY_PC;
+ break;
+
+ default:
+ err("Unhandled/Unknown Facility type: [0x%x]", facility_type);
+
+ FAIL_RESPONSE(invocation, DEFAULT_MSG_REQ_FAILED);
+
+ return TRUE;
+ }
+
+ req.password_length = strlen(password);
+ memcpy(req.password, password, req.password_length);
+
+ dbg("[%s] Facility - type: [0x%02x] Passowrd len: [%d]",
+ GET_CP_NAME(invocation),
+ req.type, req.password_length);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sim, invocation,
+ TREQ_SIM_DISABLE_FACILITY,
+ &req, sizeof(struct treq_sim_disable_facility));
+
+ return TRUE;
+}
+
+static gboolean on_sim_enable_facility(TelephonySim *sim, GDBusMethodInvocation *invocation,
+ gint facility_type,
+ const gchar *password,
+ gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ struct treq_sim_enable_facility req;
+ CoreObject *co_sim = NULL;
+
+ if (!check_access_control(invocation, AC_SIM, "x"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, ENABLE_FACILITY, co_sim);
+ DBUS_SIM_CHECK_SIM_TYPE(co_sim, "Enable Facility");
+
+ memset(&req, 0x0, sizeof(struct treq_sim_enable_facility));
+
+ dbg("[%s] facility_type: [%d]", GET_CP_NAME(invocation), facility_type);
+ switch (facility_type) {
+ case 1:
+ req.type = SIM_FACILITY_PS;
+ break;
+
+ case 3:
+ req.type = SIM_FACILITY_SC;
+ break;
+
+ case 4:
+ req.type = SIM_FACILITY_FD;
+ break;
+
+ case 5:
+ req.type = SIM_FACILITY_PN;
+ break;
+
+ case 6:
+ req.type = SIM_FACILITY_PU;
+ break;
+
+ case 7:
+ req.type = SIM_FACILITY_PP;
+ break;
+
+ case 8:
+ req.type = SIM_FACILITY_PC;
+ break;
+
+ default:
+ err("Unhandled/Unknown Facility type: [0x%x]", facility_type);
+
+ FAIL_RESPONSE(invocation, DEFAULT_MSG_REQ_FAILED);
+
+ return TRUE;
+ }
+
+ req.password_length = strlen(password);
+ memcpy(req.password, password, req.password_length);
+
+ dbg("[%s] Facility - type: [0x%02x] Passowrd len: [%d]",
+ GET_CP_NAME(invocation),
+ req.type, req.password_length);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sim, invocation,
+ TREQ_SIM_ENABLE_FACILITY,
+ &req, sizeof(struct treq_sim_enable_facility));
+
+ return TRUE;
+}
+
+static gboolean on_sim_get_facility(TelephonySim *sim,
+ GDBusMethodInvocation *invocation,
+ gint facility_type, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ struct treq_sim_get_facility_status req;
+ CoreObject *co_sim = NULL;
+
+ if (!check_access_control(invocation, AC_SIM, "r"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, GET_FACILITY, co_sim);
+ DBUS_SIM_CHECK_SIM_TYPE(co_sim, "Get Facility");
+
+ memset(&req, 0x0, sizeof(struct treq_sim_get_facility_status));
+
+ dbg("[%s] facility_type: [%d]", GET_CP_NAME(invocation), facility_type);
+
+ switch (facility_type) {
+ case 1:
+ req.type = SIM_FACILITY_PS;
+ break;
+
+ case 3:
+ req.type = SIM_FACILITY_SC;
+ break;
+
+ case 4:
+ req.type = SIM_FACILITY_FD;
+ break;
+
+ case 5:
+ req.type = SIM_FACILITY_PN;
+ break;
+
+ case 6:
+ req.type = SIM_FACILITY_PU;
+ break;
+
+ case 7:
+ req.type = SIM_FACILITY_PP;
+ break;
+
+ case 8:
+ req.type = SIM_FACILITY_PC;
+ break;
+
+ default:
+ err("Unhandled/Unknown Facility type: [0x%x]", facility_type);
+
+ FAIL_RESPONSE(invocation, DEFAULT_MSG_REQ_FAILED);
+
+ return TRUE;
+ }
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sim, invocation,
+ TREQ_SIM_GET_FACILITY_STATUS,
+ &req, sizeof(struct treq_sim_get_facility_status));
+
+ return TRUE;
+}
+
+static gboolean on_sim_get_lock_info(TelephonySim *sim,
+ GDBusMethodInvocation *invocation,
+ gint facility_type, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ CoreObject *co_sim = NULL;
+ struct treq_sim_get_lock_info req;
+
+ if (!check_access_control(invocation, AC_SIM, "r"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, GET_LOCK_INFO, co_sim);
+ DBUS_SIM_CHECK_SIM_TYPE(co_sim, "Get Lock Info");
+
+ memset(&req, 0x0, sizeof(struct treq_sim_get_lock_info));
+
+ dbg("[%s] facility_type: [%d]", GET_CP_NAME(invocation), facility_type);
+ switch (facility_type) {
+ case 1:
+ req.type = SIM_FACILITY_PS;
+ break;
+
+ case 3:
+ req.type = SIM_FACILITY_SC;
+ break;
+
+ case 4:
+ req.type = SIM_FACILITY_FD;
+ break;
+
+ case 5:
+ req.type = SIM_FACILITY_PN;
+ break;
+
+ case 6:
+ req.type = SIM_FACILITY_PU;
+ break;
+
+ case 7:
+ req.type = SIM_FACILITY_PP;
+ break;
+
+ case 8:
+ req.type = SIM_FACILITY_PC;
+ break;
+
+ default:
+ err("Unhandled/Unknown Facility type: [0x%x]", facility_type);
+
+ FAIL_RESPONSE(invocation, DEFAULT_MSG_REQ_FAILED);
+
+ return TRUE;
+ }
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sim, invocation,
+ TREQ_SIM_GET_LOCK_INFO,
+ &req, sizeof(struct treq_sim_get_lock_info));
+
+ return TRUE;
+}
+
+static gboolean on_sim_transfer_apdu(TelephonySim *sim,
+ GDBusMethodInvocation *invocation,
+ GVariant *apdu, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ struct treq_sim_transmit_apdu req;
+ GVariantIter *iter = NULL;
+ GVariant *inner_gv = NULL;
+ guchar rt_i;
+ CoreObject *co_sim = NULL;
+ int i = 0;
+
+ if (!check_access_control(invocation, AC_SIM, "x"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, TRANSFER_APDU, co_sim);
+ DBUS_SIM_CHECK_SIM_TYPE(co_sim, "Transfer APDU");
+
+ memset(&req, 0x0, sizeof(struct treq_sim_transmit_apdu));
+
+ inner_gv = g_variant_get_variant(apdu);
+
+ g_variant_get(inner_gv, "ay", &iter);
+ while (g_variant_iter_loop(iter, "y", &rt_i)) {
+ req.apdu[i] = rt_i;
+ i++;
+ }
+ req.apdu_length = (unsigned int)i;
+ g_variant_iter_free(iter);
+ g_variant_unref(inner_gv);
+ g_variant_unref(apdu);
+
+ tcore_util_hex_dump("[APDU_REQ] ", req.apdu_length, req.apdu);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sim, invocation,
+ TREQ_SIM_TRANSMIT_APDU,
+ &req, sizeof(struct treq_sim_transmit_apdu));
+
+ return TRUE;
+}
+
+static gboolean on_sim_get_atr(TelephonySim *sim,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ CoreObject *co_sim = NULL;
+
+ if (!check_access_control(invocation, AC_SIM, "r"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, GET_ATR, co_sim);
+ DBUS_SIM_CHECK_SIM_TYPE(co_sim, "Get ATR");
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sim, invocation,
+ TREQ_SIM_GET_ATR,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_sim_get_fields(TelephonySim *sim,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ struct tel_sim_imsi *n_imsi = NULL;
+ CoreObject *co_sim = NULL;
+ GVariantBuilder b;
+ GVariant *gv_fields = NULL;
+
+ if (!check_access_control(invocation, AC_SIM, "r"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("a{svv}}"));
+
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, GET_IMSI, co_sim);
+
+ n_imsi = tcore_sim_get_imsi(co_sim);
+ if (n_imsi != NULL) {
+ g_variant_builder_add(&b, "{svv}", "imsi",
+ g_variant_new_string("plmn"),
+ g_variant_new_string(n_imsi->plmn));
+ g_variant_builder_add(&b, "{svv}", "imsi",
+ g_variant_new_string("msin"),
+ g_variant_new_string(n_imsi->msin));
+ free(n_imsi);
+ }
+
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, GET_ICCID, co_sim);
+ g_variant_builder_add(&b, "{svv}", "iccid",
+ g_variant_new_string(""), g_variant_new_string(""));
+
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, GET_MSISDN, co_sim);
+ g_variant_builder_add(&b, "{svv}", "msisdn",
+ g_variant_new_string("name"), g_variant_new_string("number"));
+
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, GET_SPN, co_sim);
+ g_variant_builder_add(&b, "{svv}", "spn",
+ g_variant_new_uint16(255), g_variant_new_string("network name"));
+
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, GET_INIT_STATUS, co_sim);
+ g_variant_builder_add(&b, "{svv}", "init_status",
+ g_variant_new_uint16(0), g_variant_new_boolean(TRUE));
+
+ gv_fields = g_variant_builder_end(&b);
+
+ telephony_sim_complete_get_fields(sim,
+ invocation, 0, gv_fields);
+
+ return TRUE;
+}
+
+static gboolean on_sim_set_power_state(TelephonySim *sim,
+ GDBusMethodInvocation *invocation, gint state, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ CoreObject *co_sim = NULL;
+ struct treq_sim_set_powerstate req;
+
+ if (!check_access_control(invocation, AC_SIM, "w"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, SET_POWERSTATE, co_sim);
+
+ memset(&req, 0x0, sizeof(struct treq_sim_set_powerstate));
+
+ req.state = state;
+
+ dbg("[%s] SIM Power state: [%d]",
+ GET_CP_NAME(invocation), req.state);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sim, invocation,
+ TREQ_SIM_SET_POWERSTATE,
+ &req, sizeof(struct treq_sim_set_powerstate));
+
+ return TRUE;
+}
+
+static gboolean on_sim_get_impi(TelephonySim *sim,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ CoreObject *co_sim = NULL;
+
+ if (!check_access_control(invocation, AC_SIM, "r"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, GET_IMPI, co_sim);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sim, invocation,
+ TREQ_SIM_GET_IMPI,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_sim_get_impu(TelephonySim *sim,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ CoreObject *co_sim = NULL;
+
+ if (!check_access_control(invocation, AC_SIM, "r"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, GET_IMPU, co_sim);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sim, invocation,
+ TREQ_SIM_GET_IMPU,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_sim_get_domain(TelephonySim *sim,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ CoreObject *co_sim = NULL;
+
+ if (!check_access_control(invocation, AC_SIM, "r"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, GET_DOMAIN, co_sim);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sim, invocation,
+ TREQ_SIM_GET_DOMAIN,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_sim_get_pcscf(TelephonySim *sim,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ CoreObject *co_sim = NULL;
+
+ if (!check_access_control(invocation, AC_SIM, "r"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, GET_PCSCF, co_sim);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sim, invocation,
+ TREQ_SIM_GET_PCSCF,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_sim_get_app_list(TelephonySim *sim,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ CoreObject *co_sim = NULL;
+ unsigned char app_list = 0;
+
+ if (!check_access_control(invocation, AC_SIM, "r"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, GET_APP_LIST, co_sim);
+
+ app_list = tcore_sim_get_app_list(co_sim);
+
+ telephony_sim_complete_get_app_list(sim,
+ invocation, app_list);
+
+ return TRUE;
+}
+
+static gboolean on_sim_get_isim_service_table(TelephonySim *sim,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ struct tel_sim_ist *ist = NULL;
+ CoreObject *co_sim = NULL;
+
+ if (!check_access_control(invocation, AC_SIM, "r"))
+ return TRUE;
+
+ DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
+ DBUS_SIM_CHECK_SIM_STATUS(invocation, GET_ISIM_SERVICE_TABLE, co_sim);
+
+ ist = tcore_sim_get_isim_service_table(co_sim);
+ if (ist) {
+ GVariantBuilder builder;
+ GVariant *ist_gv = NULL;
+ GVariant *inner_gv = NULL;
+ int i;
+
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("ay"));
+ for (i = 0; i < SIM_IST_SERVICE_CNT_MAX; i++)
+ g_variant_builder_add(&builder, "y", ist->service[i]);
+ inner_gv = g_variant_builder_end(&builder);
+ ist_gv = g_variant_new("v", inner_gv);
+
+ telephony_sim_complete_get_isim_service_table(sim, invocation,
+ SIM_ACCESS_SUCCESS, ist_gv);
+
+ g_free(ist);
+ } else {
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sim, invocation,
+ TREQ_SIM_GET_ISIM_SERVICE_TABLE,
+ NULL, 0);
+ }
+
+ return TRUE;
+}
+
+gboolean dbus_plugin_setup_sim_interface(TelephonyObjectSkeleton *object,
+ struct custom_data *ctx)
+{
+ TelephonySim *sim;
+
+ sim = telephony_sim_skeleton_new();
+ telephony_object_skeleton_set_sim(object, sim);
+ g_object_unref(sim);
+
+ dbg("sim = %p", sim);
+
+ /*
+ * Register signal handlers for SIM interface
+ */
+ g_signal_connect(sim,
+ "handle-get-init-status",
+ G_CALLBACK(on_sim_get_init_status), ctx);
+
+ g_signal_connect(sim,
+ "handle-get-card-type",
+ G_CALLBACK(on_sim_get_card_type), ctx);
+
+ g_signal_connect(sim,
+ "handle-get-imsi",
+ G_CALLBACK(on_sim_get_imsi), ctx);
+
+ g_signal_connect(sim,
+ "handle-get-ecc",
+ G_CALLBACK(on_sim_get_ecc), ctx);
+
+ g_signal_connect(sim,
+ "handle-get-iccid",
+ G_CALLBACK(on_sim_get_iccid), ctx);
+
+ g_signal_connect(sim,
+ "handle-get-language",
+ G_CALLBACK(on_sim_get_language), ctx);
+
+ g_signal_connect(sim,
+ "handle-set-language",
+ G_CALLBACK(on_sim_set_language), ctx);
+
+ g_signal_connect(sim,
+ "handle-get-call-forwarding",
+ G_CALLBACK(on_sim_get_call_forwarding), ctx);
+
+ g_signal_connect(sim,
+ "handle-set-call-forwarding",
+ G_CALLBACK(on_sim_set_call_forwarding), ctx);
+
+ g_signal_connect(sim,
+ "handle-get-message-waiting",
+ G_CALLBACK(on_sim_get_message_waiting), ctx);
+
+ g_signal_connect(sim,
+ "handle-set-message-waiting",
+ G_CALLBACK(on_sim_set_message_waiting), ctx);
+
+ g_signal_connect(sim,
+ "handle-get-mailbox",
+ G_CALLBACK(on_sim_get_mailbox), ctx);
+
+ g_signal_connect(sim,
+ "handle-set-mailbox",
+ G_CALLBACK(on_sim_set_mailbox), ctx);
+
+ g_signal_connect(sim,
+ "handle-get-cphsinfo",
+ G_CALLBACK(on_sim_get_cphsinfo), ctx);
+
+ g_signal_connect(sim,
+ "handle-get-service-table",
+ G_CALLBACK(on_sim_get_service_table), ctx);
+
+ g_signal_connect(sim,
+ "handle-get-msisdn",
+ G_CALLBACK(on_sim_get_msisdn), ctx);
+
+ g_signal_connect(sim,
+ "handle-get-oplmnwact",
+ G_CALLBACK(on_sim_get_oplmnwact), ctx);
+
+ g_signal_connect(sim,
+ "handle-get-spn",
+ G_CALLBACK(on_sim_get_spn), ctx);
+
+ g_signal_connect(sim,
+ "handle-get-cphs-net-name",
+ G_CALLBACK(on_sim_get_cphs_netname), ctx);
+
+ g_signal_connect(sim,
+ "handle-get-gid",
+ G_CALLBACK(on_sim_get_gid), ctx);
+
+ g_signal_connect(sim,
+ "handle-authentication",
+ G_CALLBACK(on_sim_authentication), ctx);
+
+ g_signal_connect(sim,
+ "handle-verify-sec",
+ G_CALLBACK(on_sim_verify_sec), ctx);
+
+ g_signal_connect(sim,
+ "handle-verify-puk",
+ G_CALLBACK(on_sim_verify_puk), ctx);
+
+ g_signal_connect(sim,
+ "handle-change-pin",
+ G_CALLBACK(on_sim_change_pin), ctx);
+
+ g_signal_connect(sim,
+ "handle-disable-facility",
+ G_CALLBACK(on_sim_disable_facility), ctx);
+
+ g_signal_connect(sim,
+ "handle-enable-facility",
+ G_CALLBACK(on_sim_enable_facility), ctx);
+
+ g_signal_connect(sim,
+ "handle-get-facility",
+ G_CALLBACK(on_sim_get_facility), ctx);
+
+ g_signal_connect(sim,
+ "handle-get-lock-info",
+ G_CALLBACK(on_sim_get_lock_info), ctx);
+
+ g_signal_connect(sim,
+ "handle-transfer-apdu",
+ G_CALLBACK(on_sim_transfer_apdu), ctx);
+
+ g_signal_connect(sim,
+ "handle-get-atr",
+ G_CALLBACK(on_sim_get_atr), ctx);
+
+ g_signal_connect(sim,
+ "handle-get-fields",
+ G_CALLBACK(on_sim_get_fields), ctx);
+
+ g_signal_connect(sim,
+ "handle-set-powerstate",
+ G_CALLBACK(on_sim_set_power_state), ctx);
+
+ g_signal_connect(sim,
+ "handle-get-impi",
+ G_CALLBACK(on_sim_get_impi), ctx);
+
+ g_signal_connect(sim,
+ "handle-get-impu",
+ G_CALLBACK(on_sim_get_impu), ctx);
+
+ g_signal_connect(sim,
+ "handle-get-domain",
+ G_CALLBACK(on_sim_get_domain), ctx);
+
+ g_signal_connect(sim,
+ "handle-get-pcscf",
+ G_CALLBACK(on_sim_get_pcscf), ctx);
+
+ g_signal_connect(sim,
+ "handle-get-app-list",
+ G_CALLBACK(on_sim_get_app_list), ctx);
+
+ g_signal_connect(sim,
+ "handle-get-isim-service-table",
+ G_CALLBACK(on_sim_get_isim_service_table), ctx);
+
+ /*
+ * Initialize DBUS property
+ */
+ telephony_sim_set_cf_state(sim, FALSE);
+
+ return TRUE;
+}
+
+gboolean dbus_plugin_sim_response(struct custom_data *ctx,
+ UserRequest *ur, struct dbus_request_info *dbus_info,
+ enum tcore_response_command command, unsigned int data_len, const void *data)
+{
+ char *cpname = dbus_info ? GET_CP_NAME(dbus_info->invocation) : "";
+
+ switch (command) {
+ case TRESP_SIM_GET_ECC: {
+ const struct tresp_sim_read *resp_read = data;
+ CoreObject *co_sim = NULL;
+ GVariant *gv = NULL;
+ GVariantBuilder b;
+ int i = 0;
+
+ dbg("[%s] SIM_GET_ECC - Result: [%s])", cpname,
+ (resp_read->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"));
+
+ co_sim = __get_sim_co_from_ur(ctx->server, ur);
+ if (!co_sim) {
+ err("SIM Core object is NULL");
+ return FALSE;
+ }
+
+ if (resp_read->result == SIM_ACCESS_SUCCESS)
+ tcore_sim_set_ecc_list(co_sim, &resp_read->data.ecc);
+ else if (resp_read->result == SIM_ACCESS_FILE_NOT_FOUND)
+ tcore_sim_set_ecc_list(co_sim, NULL);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+ for (i = 0; i < resp_read->data.ecc.ecc_count; i++) {
+ dbg("[%s] ecc[%d] : ecc_category=[0x%x], ecc_num=[%s], " \
+ "ecc_string=[%s]", cpname, i,
+ resp_read->data.ecc.ecc[i].ecc_category,
+ resp_read->data.ecc.ecc[i].ecc_num,
+ resp_read->data.ecc.ecc[i].ecc_string);
+
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "category",
+ g_variant_new_int32(resp_read->data.ecc.ecc[i].ecc_category));
+ g_variant_builder_add(&b, "{sv}", "number",
+ g_variant_new_string(resp_read->data.ecc.ecc[i].ecc_num));
+ g_variant_builder_add(&b, "{sv}", "name",
+ g_variant_new_string(resp_read->data.ecc.ecc[i].ecc_string));
+ g_variant_builder_close(&b);
+ }
+ gv = g_variant_builder_end(&b);
+
+ telephony_sim_complete_get_ecc(dbus_info->interface_object,
+ dbus_info->invocation, gv);
+ }
+ break;
+
+ case TRESP_SIM_GET_ICCID: {
+ const struct tresp_sim_read *resp_read = data;
+ CoreObject *co_sim = NULL;
+
+ dbg("[%s] SIM_GET_ICCID - Result: [%s] ICCID: [%s])", cpname,
+ (resp_read->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"),
+ resp_read->data.iccid.iccid);
+
+ co_sim = __get_sim_co_from_ur(ctx->server, ur);
+ if (!co_sim) {
+ err("SIM Core object is NULL");
+ return FALSE;
+ }
+
+ if (resp_read->result == SIM_ACCESS_SUCCESS)
+ tcore_sim_set_iccid(co_sim, &resp_read->data.iccid);
+ else if (resp_read->result == SIM_ACCESS_FILE_NOT_FOUND)
+ tcore_sim_set_iccid(co_sim, NULL);
+
+ telephony_sim_complete_get_iccid(dbus_info->interface_object,
+ dbus_info->invocation, resp_read->result,
+ resp_read->data.iccid.iccid);
+ }
+ break;
+
+ case TRESP_SIM_GET_LANGUAGE: {
+ const struct tresp_sim_read *resp_read = data;
+
+ dbg("[%s] SIM_GET_LANGUAGE - Result: [%s] Language: [0x%2x]", cpname,
+ (resp_read->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"),
+ resp_read->data.language.language[0]);
+
+ telephony_sim_complete_get_language(dbus_info->interface_object,
+ dbus_info->invocation, resp_read->result,
+ resp_read->data.language.language[0]);
+ }
+ break;
+
+ case TRESP_SIM_SET_LANGUAGE: {
+ const struct tresp_sim_set_data *resp_set_data = data;
+
+ dbg("[%s] SIM_SET_LANGUAGE - Result: [%s]", cpname,
+ (resp_set_data->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"));
+
+ telephony_sim_complete_set_language(dbus_info->interface_object,
+ dbus_info->invocation, resp_set_data->result);
+ }
+ break;
+
+ case TRESP_SIM_GET_CALLFORWARDING: {
+ const struct tresp_sim_read *resp_read = data;
+ GVariant *gv_cf = NULL;
+ GVariant *gv_cphs_cf = NULL;
+ GVariantBuilder b;
+
+ dbg("[%s] SIM_GET_CALLFORWARDING - Result: [%s] CPHS: [%s]",
+ cpname, (resp_read->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"),
+ (resp_read->data.cf.b_cphs ? "Yes" : "No"));
+
+ if (resp_read->data.cf.b_cphs) {
+ dbg("[%s] b_line1[%d], b_line2[%d], b_fax[%d], b_data[%d]",
+ cpname, resp_read->data.cf.cphs_cf.b_line1,
+ resp_read->data.cf.cphs_cf.b_line2,
+ resp_read->data.cf.cphs_cf.b_fax,
+ resp_read->data.cf.cphs_cf.b_data);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "b_line1",
+ g_variant_new_boolean(resp_read->data.cf.cphs_cf.b_line1));
+ g_variant_builder_add(&b, "{sv}", "b_line2",
+ g_variant_new_boolean(resp_read->data.cf.cphs_cf.b_line2));
+ g_variant_builder_add(&b, "{sv}", "b_fax",
+ g_variant_new_boolean(resp_read->data.cf.cphs_cf.b_fax));
+ g_variant_builder_add(&b, "{sv}", "b_data",
+ g_variant_new_boolean(resp_read->data.cf.cphs_cf.b_data));
+ gv_cphs_cf = g_variant_builder_end(&b);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+ gv_cf = g_variant_builder_end(&b);
+
+ } else {
+ int i = 0;
+
+ dbg("[%s] Profile count: [%d]", cpname, resp_read->data.cf.cf_list.profile_count);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+ for (i = 0; i < resp_read->data.cf.cf_list.profile_count; i++) {
+ dbg("[%s] [%d] : rec_index[0x%x], msp_num[0x%x], " \
+ "cfu_status[0x%x], cfu_num[%s], ton[0x%x], " \
+ "npi[0x%x], cc2_id[0x%x], ext7_id[0x%x]", cpname, i,
+ resp_read->data.cf.cf_list.cf[i].rec_index,
+ resp_read->data.cf.cf_list.cf[i].msp_num,
+ resp_read->data.cf.cf_list.cf[i].cfu_status,
+ resp_read->data.cf.cf_list.cf[i].cfu_num,
+ resp_read->data.cf.cf_list.cf[i].ton,
+ resp_read->data.cf.cf_list.cf[i].npi,
+ resp_read->data.cf.cf_list.cf[i].cc2_id,
+ resp_read->data.cf.cf_list.cf[i].ext7_id);
+
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "rec_index",
+ g_variant_new_int32(resp_read->data.cf.cf_list.cf[i].rec_index));
+ g_variant_builder_add(&b, "{sv}", "msp_num",
+ g_variant_new_byte(resp_read->data.cf.cf_list.cf[i].msp_num));
+ g_variant_builder_add(&b, "{sv}", "cfu_status",
+ g_variant_new_byte(resp_read->data.cf.cf_list.cf[i].cfu_status));
+ g_variant_builder_add(&b, "{sv}", "cfu_num",
+ g_variant_new_string(resp_read->data.cf.cf_list.cf[i].cfu_num));
+ g_variant_builder_add(&b, "{sv}", "ton",
+ g_variant_new_int32(resp_read->data.cf.cf_list.cf[i].ton));
+ g_variant_builder_add(&b, "{sv}", "npi",
+ g_variant_new_int32(resp_read->data.cf.cf_list.cf[i].npi));
+ g_variant_builder_add(&b, "{sv}", "cc2_id",
+ g_variant_new_byte(resp_read->data.cf.cf_list.cf[i].cc2_id));
+ g_variant_builder_add(&b, "{sv}", "ext7_id",
+ g_variant_new_byte(resp_read->data.cf.cf_list.cf[i].ext7_id));
+ g_variant_builder_close(&b);
+ }
+ gv_cf = g_variant_builder_end(&b);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("a{sv}"));
+ gv_cphs_cf = g_variant_builder_end(&b);
+ }
+
+ telephony_sim_complete_get_call_forwarding(dbus_info->interface_object,
+ dbus_info->invocation, resp_read->result,
+ resp_read->data.cf.b_cphs, gv_cf, gv_cphs_cf);
+ }
+ break;
+
+ case TRESP_SIM_SET_CALLFORWARDING: {
+ const struct tresp_sim_set_data *resp_set_data = data;
+
+ dbg("[%s] SIM_SET_CALLFORWARDING - Result: [%s]", cpname,
+ (resp_set_data->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"));
+
+ telephony_sim_complete_set_call_forwarding(dbus_info->interface_object,
+ dbus_info->invocation, resp_set_data->result);
+ }
+ break;
+
+ case TRESP_SIM_GET_MESSAGEWAITING: {
+ const struct tresp_sim_read *resp_read = data;
+ GVariant *gv_mw = NULL;
+ GVariant *gv_cphs_mw = NULL;
+ GVariantBuilder b;
+
+ dbg("[%s] SIM_GET_MESSAGEWAITING - Result: [%s] CPHS: [%s]",
+ cpname, (resp_read->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"),
+ (resp_read->data.mw.b_cphs ? "Yes" : "No"));
+
+ if (resp_read->data.mw.b_cphs) {
+ dbg("[%s] b_voice1[%d], b_voice2[%d], b_fax[%d], b_data[%d]",
+ cpname, resp_read->data.mw.cphs_mw.b_voice1,
+ resp_read->data.mw.cphs_mw.b_voice2,
+ resp_read->data.mw.cphs_mw.b_fax,
+ resp_read->data.mw.cphs_mw.b_data);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "b_voice1",
+ g_variant_new_boolean(resp_read->data.mw.cphs_mw.b_voice1));
+ g_variant_builder_add(&b, "{sv}", "b_voice2",
+ g_variant_new_boolean(resp_read->data.mw.cphs_mw.b_voice2));
+ g_variant_builder_add(&b, "{sv}", "b_fax",
+ g_variant_new_boolean(resp_read->data.mw.cphs_mw.b_fax));
+ g_variant_builder_add(&b, "{sv}", "b_data",
+ g_variant_new_boolean(resp_read->data.mw.cphs_mw.b_data));
+ gv_cphs_mw = g_variant_builder_end(&b);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+ gv_mw = g_variant_builder_end(&b);
+
+ } else {
+ int i = 0;
+
+ dbg("[%s] Profile count: [%d]", cpname,
+ resp_read->data.mw.mw_list.profile_count);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+ for (i = 0; i < resp_read->data.mw.mw_list.profile_count; i++) {
+ dbg("[%s] mw[%d] : rec_index[0x%x], indicator_status[0x%x], " \
+ "voice_count[0x%x], fax_count[0x%x] email_count[0x%x], " \
+ "other_count[0x%x], video_count[0x%x]", cpname, i,
+ resp_read->data.mw.mw_list.mw[i].rec_index,
+ resp_read->data.mw.mw_list.mw[i].indicator_status,
+ resp_read->data.mw.mw_list.mw[i].voice_count,
+ resp_read->data.mw.mw_list.mw[i].fax_count,
+ resp_read->data.mw.mw_list.mw[i].email_count,
+ resp_read->data.mw.mw_list.mw[i].other_count,
+ resp_read->data.mw.mw_list.mw[i].video_count);
+
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "rec_index",
+ g_variant_new_int32(resp_read->data.mw.mw_list.mw[i].rec_index));
+ g_variant_builder_add(&b, "{sv}", "indicator_status",
+ g_variant_new_byte(resp_read->data.mw.mw_list.mw[i].indicator_status));
+ g_variant_builder_add(&b, "{sv}", "voice_count",
+ g_variant_new_int32(resp_read->data.mw.mw_list.mw[i].voice_count));
+ g_variant_builder_add(&b, "{sv}", "fax_count",
+ g_variant_new_int32(resp_read->data.mw.mw_list.mw[i].fax_count));
+ g_variant_builder_add(&b, "{sv}", "email_count",
+ g_variant_new_int32(resp_read->data.mw.mw_list.mw[i].email_count));
+ g_variant_builder_add(&b, "{sv}", "other_count",
+ g_variant_new_int32(resp_read->data.mw.mw_list.mw[i].other_count));
+ g_variant_builder_add(&b, "{sv}", "video_count",
+ g_variant_new_int32(resp_read->data.mw.mw_list.mw[i].video_count));
+ g_variant_builder_close(&b);
+ }
+ gv_mw = g_variant_builder_end(&b);
+ g_variant_builder_init(&b, G_VARIANT_TYPE("a{sv}"));
+ gv_cphs_mw = g_variant_builder_end(&b);
+ }
+
+ telephony_sim_complete_get_message_waiting(dbus_info->interface_object,
+ dbus_info->invocation, resp_read->result,
+ resp_read->data.mw.b_cphs, gv_mw, gv_cphs_mw);
+ }
+ break;
+
+ case TRESP_SIM_SET_MESSAGEWAITING: {
+ const struct tresp_sim_set_data *resp_set_data = data;
+
+ dbg("[%s] SIM_SET_MESSAGEWAITING - Result: [%s]",
+ cpname, (resp_set_data->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"));
+
+ telephony_sim_complete_set_message_waiting(dbus_info->interface_object,
+ dbus_info->invocation, resp_set_data->result);
+ }
+ break;
+
+ case TRESP_SIM_GET_MAILBOX: {
+ const struct tresp_sim_read *resp_read = data;
+ GVariant *gv = NULL;
+ GVariantBuilder b;
+ int i = 0;
+
+ dbg("[%s] SIM_GET_MAILBOX - Result: [%s] CPHS: [%s] Count: [%d])",
+ cpname, (resp_read->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"),
+ (resp_read->data.mb.b_cphs ? "Yes" : "No"),
+ resp_read->data.mb.count);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+ for (i = 0; i < resp_read->data.mb.count; i++) {
+ dbg("[%s] mb[%d] : rec_index[%d], profile_number[%d], mb_type[%d], " \
+ "alpha_id_max_len[%d]alpha_id[%s], ton[%d], npi[%d], num[%s], " \
+ "cc_id[%d], ext1_id[%d]", cpname, i,
+ resp_read->data.mb.mb[i].rec_index, resp_read->data.mb.mb[i].profile_number,
+ resp_read->data.mb.mb[i].mb_type, resp_read->data.mb.mb[i].number_info.alpha_id_max_len,
+ resp_read->data.mb.mb[i].number_info.alpha_id, resp_read->data.mb.mb[i].number_info.ton,
+ resp_read->data.mb.mb[i].number_info.npi, resp_read->data.mb.mb[i].number_info.num,
+ resp_read->data.mb.mb[i].number_info.cc_id, resp_read->data.mb.mb[i].number_info.ext1_id);
+
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "rec_index",
+ g_variant_new_int32(resp_read->data.mb.mb[i].rec_index));
+ g_variant_builder_add(&b, "{sv}", "profile_num",
+ g_variant_new_int32(resp_read->data.mb.mb[i].profile_number));
+ g_variant_builder_add(&b, "{sv}", "mb_type",
+ g_variant_new_int32(resp_read->data.mb.mb[i].mb_type));
+ g_variant_builder_add(&b, "{sv}", "alpha_id_max_len",
+ g_variant_new_int32(resp_read->data.mb.mb[i].number_info.alpha_id_max_len));
+ g_variant_builder_add(&b, "{sv}", "alpha_id",
+ g_variant_new_string(resp_read->data.mb.mb[i].number_info.alpha_id));
+ g_variant_builder_add(&b, "{sv}", "ton",
+ g_variant_new_int32(resp_read->data.mb.mb[i].number_info.ton));
+ g_variant_builder_add(&b, "{sv}", "npi",
+ g_variant_new_int32(resp_read->data.mb.mb[i].number_info.npi));
+ g_variant_builder_add(&b, "{sv}", "num",
+ g_variant_new_string(resp_read->data.mb.mb[i].number_info.num));
+ g_variant_builder_add(&b, "{sv}", "cc_id",
+ g_variant_new_byte(resp_read->data.mb.mb[i].number_info.cc_id));
+ g_variant_builder_add(&b, "{sv}", "ext1_id",
+ g_variant_new_byte(resp_read->data.mb.mb[i].number_info.ext1_id));
+ g_variant_builder_close(&b);
+ }
+
+ gv = g_variant_builder_end(&b);
+
+ telephony_sim_complete_get_mailbox(dbus_info->interface_object, dbus_info->invocation,
+ resp_read->result, resp_read->data.mb.b_cphs, gv);
+ }
+ break;
+
+ case TRESP_SIM_SET_MAILBOX: {
+ const struct tresp_sim_set_data *resp_set_data = data;
+
+ dbg("[%s] SIM_SET_MAILBOX - Result: [%s]", cpname,
+ (resp_set_data->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"));
+
+ telephony_sim_complete_set_mailbox(dbus_info->interface_object,
+ dbus_info->invocation, resp_set_data->result);
+ }
+ break;
+
+ case TRESP_SIM_GET_CPHS_INFO: {
+ const struct tresp_sim_read *resp_read = data;
+
+ dbg("[%s] SIM_GET_CPHS_INFO - Result: [%s]", cpname,
+ (resp_read->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"));
+
+ telephony_sim_complete_get_cphsinfo(dbus_info->interface_object,
+ dbus_info->invocation, resp_read->result,
+ resp_read->data.cphs.CphsPhase,
+ resp_read->data.cphs.CphsServiceTable.bOperatorNameShortForm,
+ resp_read->data.cphs.CphsServiceTable.bMailBoxNumbers,
+ resp_read->data.cphs.CphsServiceTable.bServiceStringTable,
+ resp_read->data.cphs.CphsServiceTable.bCustomerServiceProfile,
+ resp_read->data.cphs.CphsServiceTable.bInformationNumbers);
+ }
+ break;
+
+ case TRESP_SIM_GET_SERVICE_TABLE: {
+ const struct tresp_sim_read *resp_read = data;
+ CoreObject *co_sim = NULL;
+ GVariantBuilder builder;
+ GVariant * inner_gv = NULL;
+ GVariant *svct_gv = NULL;
+ int i = 0;
+
+ dbg("[%s] SIM_GET_SERVICE_TABLE - Result: [%s]", cpname,
+ (resp_read->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"));
+
+ co_sim = __get_sim_co_from_ur(ctx->server, ur);
+ if (!co_sim) {
+ err("SIM Core object is NULL");
+ return FALSE;
+ }
+
+ if (resp_read->result == SIM_ACCESS_SUCCESS)
+ tcore_sim_set_service_table(co_sim, &resp_read->data.svct);
+ else if (resp_read->result == SIM_ACCESS_FILE_NOT_FOUND)
+ tcore_sim_set_service_table(co_sim, NULL);
+
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("ay"));
+ if (resp_read->data.svct.sim_type == SIM_TYPE_GSM) {
+ for (i = 0; i < SIM_SST_SERVICE_CNT_MAX; i++)
+ g_variant_builder_add(&builder, "y",
+ resp_read->data.svct.table.sst.service[i]);
+ } else if (resp_read->data.svct.sim_type == SIM_TYPE_USIM) {
+ for (i = 0; i < SIM_UST_SERVICE_CNT_MAX; i++)
+ g_variant_builder_add(&builder, "y",
+ resp_read->data.svct.table.ust.service[i]);
+ } else if (resp_read->data.svct.sim_type == SIM_TYPE_RUIM) {
+ if (SIM_CDMA_SVC_TABLE == resp_read->data.svct.table.cst.cdma_svc_table) {
+ for (i = 0; i < SIM_CDMA_ST_SERVICE_CNT_MAX; i++) {
+ g_variant_builder_add(&builder, "iy",
+ resp_read->data.svct.table.cst.cdma_svc_table,
+ resp_read->data.svct.table.cst.service.cdma_service[i]);
+ }
+ } else if (SIM_CSIM_SVC_TABLE == resp_read->data.svct.table.cst.cdma_svc_table) {
+ for (i = 0; i < SIM_CSIM_ST_SERVICE_CNT_MAX; i++) {
+ g_variant_builder_add(&builder, "iy",
+ resp_read->data.svct.table.cst.cdma_svc_table,
+ resp_read->data.svct.table.cst.service.csim_service[i]);
+ }
+ } else {
+ err("Invalid cdma_svc_table:[%d]", resp_read->data.svct.table.cst.cdma_svc_table);
+ }
+ } else {
+ dbg("unknown sim type.");
+ }
+ inner_gv = g_variant_builder_end(&builder);
+ svct_gv = g_variant_new("v", inner_gv);
+
+ telephony_sim_complete_get_service_table(dbus_info->interface_object,
+ dbus_info->invocation, resp_read->result,
+ resp_read->data.svct.sim_type, svct_gv);
+ }
+ break;
+
+ case TRESP_SIM_GET_SPN: {
+ const struct tresp_sim_read *resp_read = data;
+ CoreObject *co_sim = NULL;
+
+ dbg("[%s] SIM_GET_SPN - Result: [%s] Display condition: [%d] SPN: [%s]",
+ cpname, (resp_read->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"),
+ resp_read->data.spn.display_condition, (const gchar *)resp_read->data.spn.spn);
+
+ co_sim = __get_sim_co_from_ur(ctx->server, ur);
+ if (!co_sim) {
+ err("SIM Core object is NULL");
+ return FALSE;
+ }
+
+ if (resp_read->result == SIM_ACCESS_SUCCESS)
+ tcore_sim_set_spn(co_sim, &resp_read->data.spn);
+ else if (resp_read->result == SIM_ACCESS_FILE_NOT_FOUND)
+ tcore_sim_set_spn(co_sim, NULL);
+
+ telephony_sim_complete_get_spn(dbus_info->interface_object,
+ dbus_info->invocation, resp_read->result,
+ resp_read->data.spn.display_condition,
+ (const gchar *)resp_read->data.spn.spn);
+ }
+ break;
+
+ case TRESP_SIM_GET_CPHS_NETNAME: {
+ const struct tresp_sim_read *resp_read = data;
+ CoreObject *co_sim = NULL;
+
+ dbg("[%s] SIM_GET_CPHS_NETNAME - Result: [%s]", cpname,
+ (resp_read->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"));
+
+ co_sim = __get_sim_co_from_ur(ctx->server, ur);
+ if (!co_sim) {
+ err("SIM Core object is NULL");
+ return FALSE;
+ }
+
+ if (resp_read->result == SIM_ACCESS_SUCCESS)
+ tcore_sim_set_cphs_netname(co_sim, &resp_read->data.cphs_net);
+ else if (resp_read->result == SIM_ACCESS_FILE_NOT_FOUND)
+ tcore_sim_set_cphs_netname(co_sim, NULL);
+
+ telephony_sim_complete_get_cphs_net_name(dbus_info->interface_object,
+ dbus_info->invocation, resp_read->result,
+ (const gchar *)resp_read->data.cphs_net.full_name,
+ (const gchar *)resp_read->data.cphs_net.short_name);
+ }
+ break;
+
+ case TRESP_SIM_GET_GID: {
+ const struct tresp_sim_read *resp_read = data;
+ GVariantBuilder builder;
+ GVariant *inner_gv = NULL;
+ GVariant *gid_gv = NULL;
+ int i = 0;
+
+ dbg("[%s] SIM_GET_GID - Result: [%s]", cpname,
+ (resp_read->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"));
+
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("ay"));
+ for (i = 0; i < resp_read->data.gid.GroupIdentifierLen; i++)
+ g_variant_builder_add(&builder, "y", resp_read->data.gid.szGroupIdentifier[i]);
+ inner_gv = g_variant_builder_end(&builder);
+ gid_gv = g_variant_new("v", inner_gv);
+
+ telephony_sim_complete_get_gid(dbus_info->interface_object,
+ dbus_info->invocation, resp_read->result,
+ resp_read->data.gid.GroupIdentifierLen, gid_gv);
+ }
+ break;
+
+ case TRESP_SIM_GET_MSISDN:{
+ const struct tresp_sim_read *resp_read = data;
+ CoreObject *co_sim = NULL;
+ GVariant *gv = NULL;
+ GVariantBuilder b;
+ int i = 0;
+
+ dbg("[%s] SIM_GET_MSISDN - Result: [%s]", cpname,
+ (resp_read->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"));
+
+ co_sim = __get_sim_co_from_ur(ctx->server, ur);
+ if (!co_sim) {
+ err("SIM Core object is NULL");
+ return FALSE;
+ }
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+ if (resp_read->result == SIM_ACCESS_SUCCESS)
+ tcore_sim_set_msisdn_list(co_sim, &resp_read->data.msisdn_list);
+ else if (resp_read->result == SIM_ACCESS_FILE_NOT_FOUND)
+ tcore_sim_set_msisdn_list(co_sim, NULL);
+
+ for (i = 0; i < resp_read->data.msisdn_list.count; i++) {
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "name",
+ g_variant_new_string((const gchar *)resp_read->data.msisdn_list.msisdn[i].name));
+ if (resp_read->data.msisdn_list.msisdn[i].ton == SIM_TON_INTERNATIONAL) {
+ unsigned char *tmp = (unsigned char *)calloc(SIM_MSISDN_NUMBER_LEN_MAX + 1, 1);
+ if (tmp != NULL) {
+ tmp[0] = '+';
+
+ strncpy((char *)tmp + 1,
+ (const char*)resp_read->data.msisdn_list.msisdn[i].num,
+ SIM_MSISDN_NUMBER_LEN_MAX - 1);
+ tmp[SIM_MSISDN_NUMBER_LEN_MAX] = '\0';
+
+ g_variant_builder_add(&b, "{sv}", "number",
+ g_variant_new_string((const gchar *)tmp));
+ free(tmp);
+ } else {
+ dbg("Memory allocation failed");
+
+ g_variant_builder_add(&b, "{sv}", "number",
+ g_variant_new_string((const gchar *)resp_read->data.msisdn_list.msisdn[i].num));
+ }
+ } else {
+ g_variant_builder_add(&b, "{sv}", "number",
+ g_variant_new_string((const gchar *)resp_read->data.msisdn_list.msisdn[i].num));
+ }
+ g_variant_builder_close(&b);
+ }
+ gv = g_variant_builder_end(&b);
+
+ telephony_sim_complete_get_msisdn(dbus_info->interface_object,
+ dbus_info->invocation, resp_read->result, gv);
+ }
+ break;
+
+ case TRESP_SIM_GET_OPLMNWACT: {
+ const struct tresp_sim_read *resp_read = data;
+ GVariant *gv = NULL;
+ GVariantBuilder b;
+ int i = 0;
+
+ dbg("[%s] SIM_GET_OPLMNWACT - Result: [%s]", cpname,
+ (resp_read->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"));
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+ for (i = 0; i < resp_read->data.opwa.opwa_count; i++) {
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "plmn",
+ g_variant_new_string((const gchar *)resp_read->data.opwa.opwa[i].plmn));
+ g_variant_builder_add(&b, "{sv}", "b_umts",
+ g_variant_new_boolean(resp_read->data.opwa.opwa[i].b_umts));
+ g_variant_builder_add(&b, "{sv}", "b_gsm",
+ g_variant_new_boolean(resp_read->data.opwa.opwa[i].b_gsm));
+ g_variant_builder_close(&b);
+ }
+ gv = g_variant_builder_end(&b);
+
+ telephony_sim_complete_get_oplmnwact(dbus_info->interface_object,
+ dbus_info->invocation, resp_read->result, gv);
+ }
+ break;
+
+ case TRESP_SIM_REQ_AUTHENTICATION: {
+ const struct tresp_sim_req_authentication *resp_auth = data;
+ GVariantBuilder builder;
+ GVariant *ak = NULL;
+ GVariant *cp = NULL;
+ GVariant *it = NULL;
+ GVariant *resp = NULL;
+ GVariant *ak_gv = NULL;
+ GVariant *cp_gv = NULL;
+ GVariant *it_gv = NULL;
+ GVariant *resp_gv = NULL;
+ int i = 0;
+
+ dbg("[%s] SIM_REQ_AUTHENTICATION - Result: [%s]", cpname,
+ (resp_auth->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"));
+
+ tcore_util_hex_dump("[AUTH_KEY] ",
+ resp_auth->authentication_key_length, resp_auth->authentication_key);
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("ay"));
+ for (i = 0; i < (int)resp_auth->authentication_key_length; i++)
+ g_variant_builder_add(&builder, "y", resp_auth->authentication_key[i]);
+ ak = g_variant_builder_end(&builder);
+ ak_gv = g_variant_new("v", ak);
+
+ tcore_util_hex_dump("[CIPHER_DATA] ",
+ resp_auth->cipher_length, resp_auth->cipher_data);
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("ay"));
+ for (i = 0; i < (int)resp_auth->cipher_length; i++)
+ g_variant_builder_add(&builder, "y", resp_auth->cipher_data[i]);
+ cp = g_variant_builder_end(&builder);
+ cp_gv = g_variant_new("v", cp);
+
+ tcore_util_hex_dump("[INTEGRITY_DATA] ",
+ resp_auth->integrity_length, resp_auth->integrity_data);
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("ay"));
+ for (i = 0; i < (int)resp_auth->integrity_length; i++)
+ g_variant_builder_add(&builder, "y", resp_auth->integrity_data[i]);
+ it = g_variant_builder_end(&builder);
+ it_gv = g_variant_new("v", it);
+
+ tcore_util_hex_dump("[RESP_DATA] ",
+ resp_auth->resp_length, resp_auth->resp_data);
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("ay"));
+ for (i = 0; i < (int)resp_auth->resp_length; i++)
+ g_variant_builder_add(&builder, "y", resp_auth->resp_data[i]);
+ resp = g_variant_builder_end(&builder);
+ resp_gv = g_variant_new("v", resp);
+
+ telephony_sim_complete_authentication(dbus_info->interface_object,
+ dbus_info->invocation, resp_auth->result,
+ resp_auth->auth_type, resp_auth->auth_result,
+ ak_gv, cp_gv, it_gv, resp_gv);
+ }
+ break;
+
+ case TRESP_SIM_VERIFY_PINS: {
+ const struct tresp_sim_verify_pins *resp_verify_pins = data;
+
+ dbg("[%s] SIM_VERIFY_PINS - Result: [%s] PIN Type: [%d] Re-try count: [%d]",
+ cpname, (resp_verify_pins->result == SIM_PIN_OPERATION_SUCCESS ? "Success" : "Fail"),
+ resp_verify_pins->pin_type, resp_verify_pins->retry_count);
+
+ telephony_sim_complete_verify_sec(dbus_info->interface_object,
+ dbus_info->invocation, resp_verify_pins->result,
+ resp_verify_pins->pin_type, resp_verify_pins->retry_count);
+ }
+ break;
+
+ case TRESP_SIM_VERIFY_PUKS: {
+ const struct tresp_sim_verify_puks *resp_verify_puks = data;
+
+ dbg("[%s] SIM_VERIFY_PUKS - Result: [%s] PIN Type: [%d] Re-try count: [%d]",
+ cpname, (resp_verify_puks->result == SIM_PIN_OPERATION_SUCCESS ? "Success" : "Fail"),
+ resp_verify_puks->pin_type, resp_verify_puks->retry_count);
+
+ telephony_sim_complete_verify_puk(dbus_info->interface_object,
+ dbus_info->invocation, resp_verify_puks->result,
+ resp_verify_puks->pin_type, resp_verify_puks->retry_count);
+ }
+ break;
+
+ case TRESP_SIM_CHANGE_PINS: {
+ const struct tresp_sim_change_pins *resp_change_pins = data;
+
+ dbg("[%s] SIM_CHANGE_PINS - Result: [%s] PIN Type: [%d] Re-try count: [%d]",
+ cpname, (resp_change_pins->result == SIM_PIN_OPERATION_SUCCESS ? "Success" : "Fail"),
+ resp_change_pins->pin_type, resp_change_pins->retry_count);
+
+ telephony_sim_complete_change_pin(dbus_info->interface_object,
+ dbus_info->invocation, resp_change_pins->result,
+ resp_change_pins->pin_type, resp_change_pins->retry_count);
+ }
+ break;
+
+ case TRESP_SIM_DISABLE_FACILITY: {
+ const struct tresp_sim_disable_facility *resp_dis_facility = data;
+ gint f_type = 0;
+
+ dbg("[%s] SIM_DISABLE_FACILITY - Result: [%s] Type: [%d] Re-try count: [%d]",
+ cpname, (resp_dis_facility->result == SIM_PIN_OPERATION_SUCCESS ? "Success" : "Fail"),
+ resp_dis_facility->type, resp_dis_facility->retry_count);
+
+ switch (resp_dis_facility->type) {
+ case SIM_FACILITY_PS:
+ f_type = 1;
+ break;
+
+ case SIM_FACILITY_SC:
+ f_type = 3;
+ break;
+
+ case SIM_FACILITY_FD:
+ f_type = 4;
+ break;
+
+ case SIM_FACILITY_PN:
+ f_type = 5;
+ break;
+
+ case SIM_FACILITY_PU:
+ f_type = 6;
+ break;
+
+ case SIM_FACILITY_PP:
+ f_type = 7;
+ break;
+
+ case SIM_FACILITY_PC:
+ f_type = 8;
+ break;
+
+ default:
+ err("Unhandled/Unknown Facility type: [0x%x]", resp_dis_facility->type);
+ break;
+ }
+
+ telephony_sim_complete_disable_facility(dbus_info->interface_object,
+ dbus_info->invocation, resp_dis_facility->result,
+ f_type, resp_dis_facility->retry_count);
+ }
+ break;
+
+ case TRESP_SIM_ENABLE_FACILITY: {
+ const struct tresp_sim_enable_facility *resp_en_facility = data;
+ gint f_type = 0;
+
+ dbg("[%s] SIM_ENABLE_FACILITY - Result: [%s] Type: [%d] Re-try count: [%d]",
+ cpname, (resp_en_facility->result == SIM_PIN_OPERATION_SUCCESS ? "Success" : "Fail"),
+ resp_en_facility->type, resp_en_facility->retry_count);
+
+ switch (resp_en_facility->type) {
+ case SIM_FACILITY_PS:
+ f_type = 1;
+ break;
+
+ case SIM_FACILITY_SC:
+ f_type = 3;
+ break;
+
+ case SIM_FACILITY_FD:
+ f_type = 4;
+ break;
+
+ case SIM_FACILITY_PN:
+ f_type = 5;
+ break;
+
+ case SIM_FACILITY_PU:
+ f_type = 6;
+ break;
+
+ case SIM_FACILITY_PP:
+ f_type = 7;
+ break;
+
+ case SIM_FACILITY_PC:
+ f_type = 8;
+ break;
+
+ default:
+ err("Unhandled/Unknown Facility type: [0x%x]", resp_en_facility->type);
+ break;
+ }
+
+ telephony_sim_complete_enable_facility(dbus_info->interface_object,
+ dbus_info->invocation, resp_en_facility->result,
+ f_type, resp_en_facility->retry_count);
+ }
+ break;
+
+ case TRESP_SIM_GET_FACILITY_STATUS: {
+ const struct tresp_sim_get_facility_status *resp_get_facility = data;
+ gint f_type = 0;
+
+ dbg("[%s] SIM_GET_FACILITY_STATUS - Result: [%s] Type: [%d] Enable: [%s]",
+ cpname, (resp_get_facility->result == SIM_PIN_OPERATION_SUCCESS ? "Success" : "Fail"),
+ resp_get_facility->type,
+ (resp_get_facility->b_enable ? "Yes" : "No"));
+
+ switch (resp_get_facility->type) {
+ case SIM_FACILITY_PS:
+ f_type = 1;
+ break;
+
+ case SIM_FACILITY_SC:
+ f_type = 3;
+ break;
+
+ case SIM_FACILITY_FD:
+ f_type = 4;
+ break;
+
+ case SIM_FACILITY_PN:
+ f_type = 5;
+ break;
+
+ case SIM_FACILITY_PU:
+ f_type = 6;
+ break;
+
+ case SIM_FACILITY_PP:
+ f_type = 7;
+ break;
+
+ case SIM_FACILITY_PC:
+ f_type = 8;
+ break;
+
+ default:
+ err("Unhandled/Unknown Facility type: [0x%x]", resp_get_facility->type);
+ break;
+ }
+
+ telephony_sim_complete_get_facility(dbus_info->interface_object,
+ dbus_info->invocation, resp_get_facility->result,
+ f_type, resp_get_facility->b_enable);
+ }
+ break;
+
+ case TRESP_SIM_GET_LOCK_INFO: {
+ const struct tresp_sim_get_lock_info *resp_lock = data;
+ gint f_type = 0;
+
+ dbg("[%s] SIM_GET_LOCK_INFO - Result: [%s] Type: [%d] Re-try count: [%d]",
+ cpname, (resp_lock->result == SIM_PIN_OPERATION_SUCCESS ? "Success" : "Fail"),
+ resp_lock->type, resp_lock->retry_count);
+
+ switch (resp_lock->type) {
+ case SIM_FACILITY_PS:
+ f_type = 1;
+ break;
+
+ case SIM_FACILITY_SC:
+ f_type = 3;
+ break;
+
+ case SIM_FACILITY_FD:
+ f_type = 4;
+ break;
+
+ case SIM_FACILITY_PN:
+ f_type = 5;
+ break;
+
+ case SIM_FACILITY_PU:
+ f_type = 6;
+ break;
+
+ case SIM_FACILITY_PP:
+ f_type = 7;
+ break;
+
+ case SIM_FACILITY_PC:
+ f_type = 8;
+ break;
+
+ default:
+ err("Unhandled/Unknown Lock type: [0x%x]", resp_lock->type);
+ break;
+ }
+
+ telephony_sim_complete_get_lock_info(dbus_info->interface_object,
+ dbus_info->invocation, resp_lock->result,
+ f_type, resp_lock->lock_status, resp_lock->retry_count);
+ }
+ break;
+
+ case TRESP_SIM_TRANSMIT_APDU: {
+ const struct tresp_sim_transmit_apdu *resp_apdu = data;
+ GVariantBuilder builder;
+ GVariant * apdu_gv = NULL;
+ GVariant *inner_gv = NULL;
+ int i = 0;
+
+ dbg("[%s] SIM_TRANSMIT_APDU - Result: [%s]", cpname,
+ (resp_apdu->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"));
+
+ tcore_util_hex_dump("[APDU_RESP] ",
+ resp_apdu->apdu_resp_length, resp_apdu->apdu_resp);
+
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("ay"));
+ for (i = 0; i < (int)resp_apdu->apdu_resp_length; i++)
+ g_variant_builder_add(&builder, "y", resp_apdu->apdu_resp[i]);
+ inner_gv = g_variant_builder_end(&builder);
+ apdu_gv = g_variant_new("v", inner_gv);
+
+ telephony_sim_complete_transfer_apdu(dbus_info->interface_object,
+ dbus_info->invocation, resp_apdu->result, apdu_gv);
+ }
+ break;
+
+ case TRESP_SIM_GET_ATR:{
+ const struct tresp_sim_get_atr *resp_get_atr = data;
+ GVariantBuilder builder;
+ GVariant * atr_gv = NULL;
+ GVariant *inner_gv = NULL;
+ int i = 0;
+
+ dbg("[%s] SIM_GET_ATR - Result: [%s]", cpname,
+ (resp_get_atr->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"));
+
+ tcore_util_hex_dump("[ATR_RESP] ",
+ resp_get_atr->atr_length, resp_get_atr->atr);
+
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("ay"));
+ for (i = 0; i < (int)resp_get_atr->atr_length; i++)
+ g_variant_builder_add(&builder, "y", resp_get_atr->atr[i]);
+ inner_gv = g_variant_builder_end(&builder);
+ atr_gv = g_variant_new("v", inner_gv);
+
+ telephony_sim_complete_get_atr(dbus_info->interface_object,
+ dbus_info->invocation, resp_get_atr->result, atr_gv);
+ }
+ break;
+
+ case TRESP_SIM_SET_POWERSTATE: {
+ const struct tresp_sim_set_powerstate *resp_power = data;
+
+ info("[%s] SIM_SET_POWERSTATE - Result: [%s]", cpname,
+ (resp_power->result == SIM_POWER_SET_SUCCESS ? "Success" : "Fail"));
+
+ telephony_sim_complete_set_powerstate(dbus_info->interface_object,
+ dbus_info->invocation, resp_power->result);
+ }
+ break;
+
+ case TRESP_SIM_GET_IMPI: {
+ const struct tresp_sim_read *resp_read = data;
+
+ dbg("[%s] SIM_GET_IMPI - Result: [%s]", cpname,
+ (resp_read->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"));
+
+ telephony_sim_complete_get_impi(dbus_info->interface_object,
+ dbus_info->invocation, resp_read->result,
+ resp_read->data.impi.impi);
+ }
+ break;
+
+ case TRESP_SIM_GET_IMPU: {
+ const struct tresp_sim_read *resp_read = data;
+ GVariant *gv = NULL;
+ GVariantBuilder b;
+ unsigned int i;
+
+ dbg("[%s] SIM_GET_IMPU - Result: [%s]", cpname,
+ (resp_read->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"));
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+ for (i = 0; i < resp_read->data.impu_list.count; i++) {
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "impu",
+ g_variant_new_string(resp_read->data.impu_list.impu[i].impu));
+ g_variant_builder_close(&b);
+ }
+ gv = g_variant_builder_end(&b);
+
+ telephony_sim_complete_get_impu(dbus_info->interface_object,
+ dbus_info->invocation, resp_read->result, gv);
+ }
+ break;
+
+ case TRESP_SIM_GET_DOMAIN: {
+ const struct tresp_sim_read *resp_read = data;
+
+ dbg("[%s] SIM_GET_DOMAIN - Result: [%s]", cpname,
+ (resp_read->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"));
+
+ telephony_sim_complete_get_domain(dbus_info->interface_object,
+ dbus_info->invocation, resp_read->result,
+ resp_read->data.domain.domain);
+ }
+ break;
+
+ case TRESP_SIM_GET_PCSCF: {
+ const struct tresp_sim_read *resp_read = data;
+ GVariant *gv = NULL;
+ GVariantBuilder b;
+ unsigned int i;
+
+ dbg("[%s] SIM_GET_PCSCF - Result: [%s]", cpname,
+ (resp_read->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"));
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+ for (i = 0; i < resp_read->data.pcscf_list.count; i++) {
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "type",
+ g_variant_new_int32(resp_read->data.pcscf_list.pcscf[i].type));
+ g_variant_builder_add(&b, "{sv}", "pcscf",
+ g_variant_new_string(resp_read->data.pcscf_list.pcscf[i].pcscf));
+ g_variant_builder_close(&b);
+ }
+ gv = g_variant_builder_end(&b);
+
+ telephony_sim_complete_get_pcscf(dbus_info->interface_object,
+ dbus_info->invocation, resp_read->result, gv);
+ }
+ break;
+
+ case TRESP_SIM_GET_ISIM_SERVICE_TABLE: {
+ const struct tresp_sim_read *resp_read = data;
+ GVariantBuilder builder;
+ GVariant *ist_gv = NULL;
+ GVariant *inner_gv = NULL;
+ int i;
+
+ dbg("[%s] SIM_GET_ISIM_SERVICE_TABLE - Result: [%s]", cpname,
+ (resp_read->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"));
+
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("ay"));
+ for (i = 0; i < SIM_IST_SERVICE_CNT_MAX; i++)
+ g_variant_builder_add(&builder, "y", resp_read->data.ist.service[i]);
+ inner_gv = g_variant_builder_end(&builder);
+ ist_gv = g_variant_new("v", inner_gv);
+
+ telephony_sim_complete_get_isim_service_table(dbus_info->interface_object,
+ dbus_info->invocation, resp_read->result, ist_gv);
+ }
+ break;
+
+ default:
+ err("Unhandled/Unknown Response: [0x%x]", command);
+ break;
+ }
+
+ return TRUE;
+}
+
+gboolean dbus_plugin_sim_notification(struct custom_data *ctx,
+ CoreObject *source, TelephonyObjectSkeleton *object,
+ enum tcore_notification_command command, unsigned int data_len, const void *data)
+{
+ TelephonySim *sim;
+ const char *cp_name;
+ enum dbus_tapi_sim_slot_id slot_id = SIM_SLOT_PRIMARY;
+
+ cp_name = tcore_server_get_cp_name_by_plugin(tcore_object_ref_plugin(source));
+
+ sim = telephony_object_peek_sim(TELEPHONY_OBJECT(object));
+ if (sim == NULL) {
+ err("sim object is NULL!!!");
+ return FALSE;
+ }
+
+ switch (command) {
+ case TNOTI_SIM_STATUS: {
+ const struct tnoti_sim_status *n_sim_status = data;
+ int count = 0;
+
+ info("[%s] SIM_STATUS - [%d]", cp_name,
+ n_sim_status->sim_status);
+
+#ifdef ENABLE_KPI_LOGS
+ if (n_sim_status->sim_status == SIM_STATUS_INIT_COMPLETED)
+ TIME_CHECK("[%s] SIM Initialized", cp_name);
+#endif
+
+ telephony_sim_emit_status(sim, n_sim_status->sim_status);
+
+ slot_id = get_sim_slot_id_by_cp_name(cp_name);
+ if (slot_id == SIM_SLOT_PRIMARY)
+ ctx->sim1_status = n_sim_status->sim_status;
+ else if (slot_id == SIM_SLOT_SECONDARY)
+ ctx->sim2_status = n_sim_status->sim_status;
+ else
+ warn("NOT handled Slot ID: [%d]", slot_id);
+
+ if (__is_sim_status_valid(ctx->sim1_status))
+ count++;
+
+ if (__is_sim_status_valid(ctx->sim2_status))
+ count++;
+
+ if (ctx->valid_sim_count != count) {
+ ctx->valid_sim_count = count;
+
+ telephony_manager_emit_sim_inserted(ctx->mgr, count);
+ }
+ }
+ break;
+
+ case TNOTI_SIM_REFRESHED: {
+ const struct tnoti_sim_refreshed *n_sim_refreshed = data;
+
+ info("[%s] SIM_REFRESHED - b_full_file_changed: [%s] changed_file_count: [%d]",
+ cp_name, (n_sim_refreshed->b_full_file_changed ? "YES" : "NO"),
+ n_sim_refreshed->file_list.file_count);
+
+ telephony_sim_emit_refreshed(sim, n_sim_refreshed->cmd_type);
+ }
+ break;
+
+ case TNOTI_SIM_CALL_FORWARD_STATE: {
+ const struct tnoti_sim_call_forward_state *info = data;
+
+ info("[%s] SIM_CALL_FORWARD_STATE - Call Forwarding: [%s]",
+ cp_name, info->b_forward ? "ON" : "OFF");
+
+ telephony_sim_set_cf_state(sim, info->b_forward);
+ }
+ break;
+
+ default:
+ err("Unhandled/Unknown Notification: [0x%x]", command);
+ break;
+ }
+
+ return TRUE;
+}
+
--- /dev/null
+/*
+ * tel-plugin-dbus-tapi
+ *
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Ja-young Gu <jygu@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <glib.h>
+
+#include <tcore.h>
+#include <server.h>
+#include <plugin.h>
+#include <co_sms.h>
+
+#include "generated-code.h"
+#include "dtapi_common.h"
+
+static gboolean on_sms_send_msg(TelephonySms *sms,
+ GDBusMethodInvocation *invocation,
+ gint format, GVariant *sca,
+ gint tpdu_length, GVariant *tpdu_data,
+ gint more_msg, gpointer user_data)
+{
+ struct treq_sms_send_msg req;
+ struct custom_data *ctx = user_data;
+ enum tcore_request_command command;
+
+ int i = 0;
+ GVariantIter *iter = NULL;
+ GVariant *inner_gv = NULL;
+
+ if (!check_access_control(invocation, AC_SMS, "x"))
+ return TRUE;
+
+ memset(&req, 0x0, sizeof(struct treq_sms_send_msg));
+
+ if (SMS_NETTYPE_3GPP == format) {
+ command = TREQ_SMS_SEND_UMTS_MSG;
+ } else if (SMS_NETTYPE_3GPP2 == format) {
+ command = TREQ_SMS_SEND_CDMA_MSG;
+ } else {
+ err("Invalid Format Received:[%d]", format);
+
+ FAIL_RESPONSE(invocation, DEFAULT_MSG_REQ_FAILED);
+
+ return TRUE;
+ }
+
+ inner_gv = g_variant_get_variant(sca);
+ g_variant_get(inner_gv, "ay", &iter);
+ while (g_variant_iter_loop(iter, "y", &req.msgDataPackage.sca[i])) {
+ i++;
+ if (i >= SMS_SMSP_ADDRESS_LEN)
+ break;
+ }
+ g_variant_iter_free(iter);
+ g_variant_unref(inner_gv);
+
+ req.msgDataPackage.msgLength = tpdu_length;
+
+ i = 0;
+ inner_gv = g_variant_get_variant(tpdu_data);
+ g_variant_get(inner_gv, "ay", &iter);
+ while (g_variant_iter_loop(iter, "y", &req.msgDataPackage.tpduData[i])) {
+ i++;
+ if (i >= SMS_SMDATA_SIZE_MAX + 1)
+ break;
+ }
+ g_variant_iter_free(iter);
+ g_variant_unref(inner_gv);
+
+ req.msgDataPackage.format = format;
+ req.more = more_msg;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sms, invocation,
+ command,
+ &req, sizeof(struct treq_sms_send_msg));
+
+ return TRUE;
+}
+
+static gboolean on_sms_read_msg(TelephonySms *sms,
+ GDBusMethodInvocation *invocation, gint msg_index, gpointer user_data)
+{
+ struct treq_sms_read_msg req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_SMS, "r"))
+ return TRUE;
+
+ req.index = msg_index;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sms, invocation,
+ TREQ_SMS_READ_MSG,
+ &req, sizeof(struct treq_sms_read_msg));
+
+ return TRUE;
+}
+
+static gboolean on_sms_save_msg(TelephonySms *sms,
+ GDBusMethodInvocation *invocation,
+ gint format, gint msg_status, GVariant *sca,
+ gint tpdu_length, GVariant *tpdu_data, gpointer user_data)
+{
+ struct treq_sms_save_msg req;
+ struct custom_data *ctx = user_data;
+
+ int i = 0;
+ GVariantIter *iter = NULL;
+ GVariant *inner_gv = NULL;
+
+ if (!check_access_control(invocation, AC_SMS, "w"))
+ return TRUE;
+
+ if (SMS_NETTYPE_3GPP == format) {
+ req.msgDataPackage.format = SMS_NETTYPE_3GPP;
+ } else if (SMS_NETTYPE_3GPP2 == format) {
+ req.msgDataPackage.format = SMS_NETTYPE_3GPP2;
+ } else {
+ err("Invalid Format Received:[%d]", format);
+
+ FAIL_RESPONSE(invocation, DEFAULT_MSG_REQ_FAILED);
+
+ return TRUE;
+ }
+
+ req.simIndex = 0xffff;
+ req.msgStatus = msg_status;
+
+ inner_gv = g_variant_get_variant(sca);
+ g_variant_get(inner_gv, "ay", &iter);
+ while (g_variant_iter_loop(iter, "y", &req.msgDataPackage.sca[i])) {
+ i++;
+ if (i >= SMS_SMSP_ADDRESS_LEN)
+ break;
+ }
+ g_variant_iter_free(iter);
+ g_variant_unref(inner_gv);
+
+ i = 0;
+ inner_gv = g_variant_get_variant(tpdu_data);
+ g_variant_get(inner_gv, "ay", &iter);
+ while (g_variant_iter_loop(iter, "y", &req.msgDataPackage.tpduData[i])) {
+ i++;
+ if (i >= SMS_SMDATA_SIZE_MAX + 1)
+ break;
+ }
+ g_variant_iter_free(iter);
+ g_variant_unref(inner_gv);
+
+ req.msgDataPackage.msgLength = tpdu_length;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sms, invocation,
+ TREQ_SMS_SAVE_MSG,
+ &req, sizeof(struct treq_sms_save_msg));
+
+ return TRUE;
+}
+
+static gboolean on_sms_delete_msg(TelephonySms *sms,
+ GDBusMethodInvocation *invocation, gint msg_index, gpointer user_data)
+{
+ struct treq_sms_delete_msg req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_SMS, "x"))
+ return TRUE;
+
+ req.index = msg_index;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sms, invocation,
+ TREQ_SMS_DELETE_MSG,
+ &req, sizeof(struct treq_sms_delete_msg));
+
+ return TRUE;
+}
+
+static gboolean on_sms_get_msg_count(TelephonySms *sms,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_SMS, "r"))
+ return TRUE;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sms, invocation,
+ TREQ_SMS_GET_COUNT,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_sms_get_sca(TelephonySms *sms,
+ GDBusMethodInvocation *invocation, gint msg_index, gpointer user_data)
+{
+ struct treq_sms_get_sca req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_SMS, "r"))
+ return TRUE;
+
+ req.index = msg_index;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sms, invocation,
+ TREQ_SMS_GET_SCA,
+ &req, sizeof(struct treq_sms_get_sca));
+
+ return TRUE;
+}
+
+static gboolean on_sms_set_sca(TelephonySms *sms,
+ GDBusMethodInvocation *invocation,
+ gint msg_index,
+ gint sca_ton, gint sca_npi, gint sca_length, GVariant *sca,
+ gpointer user_data)
+{
+ if (!check_access_control(invocation, AC_SMS, "w"))
+ return TRUE;
+
+ if ((sca_length <= 0)
+ || (sca_length > (SMS_MAX_SMS_SERVICE_CENTER_ADDR + 1))) {
+ err("[tcore_SMS] TAPI_API_INVALID_INPUT !!!");
+
+ FAIL_RESPONSE(invocation, DEFAULT_MSG_REQ_FAILED);
+ } else if (msg_index != 0) {
+ err("[tcore_SMS] Index except 0 is supported");
+
+ FAIL_RESPONSE(invocation, DEFAULT_MSG_REQ_FAILED);
+ } else {
+ struct treq_sms_set_sca req;
+ struct custom_data *ctx = user_data;
+
+ int i = 0;
+ GVariantIter *iter = NULL;
+ GVariant *inner_gv = NULL;
+
+ memset(&req, 0, sizeof(struct treq_sms_set_sca));
+
+ req.index = msg_index;
+ req.scaInfo.dialNumLen = sca_length;
+ req.scaInfo.typeOfNum = sca_ton;
+ req.scaInfo.numPlanId = sca_npi;
+
+ inner_gv = g_variant_get_variant(sca);
+ g_variant_get(inner_gv, "ay", &iter);
+ while (g_variant_iter_loop(iter, "y", &req.scaInfo.diallingNum[i])) {
+ i++;
+ if (i >= SMS_SMSP_ADDRESS_LEN + 1)
+ break;
+ }
+
+ g_variant_iter_free(iter);
+ g_variant_unref(inner_gv);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sms, invocation,
+ TREQ_SMS_SET_SCA,
+ &req, sizeof(struct treq_sms_set_sca));
+ }
+
+ return TRUE;
+}
+
+static gboolean on_sms_get_cb_config(TelephonySms *sms,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_SMS, "r"))
+ return TRUE;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sms, invocation,
+ TREQ_SMS_GET_CB_CONFIG,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_sms_set_cb_config(TelephonySms *sms,
+ GDBusMethodInvocation *invocation,
+ gint network_type, gboolean enable_cb,
+ gint msg_id_max_cnt, gint msg_id_range_cnt,
+ GVariant *arg_mdgId, gpointer user_data)
+{
+ struct treq_sms_set_cb_config req;
+ struct custom_data *ctx = user_data;
+
+ GVariant *value = NULL;
+ GVariant *inner_gv = NULL;
+ GVariantIter *iter = NULL;
+ GVariantIter *iter_row = NULL;
+ const gchar *key = NULL;
+ int i = 0;
+
+ if (!check_access_control(invocation, AC_SMS, "w"))
+ return TRUE;
+
+ req.net3gppType = network_type;
+ req.cbEnabled = enable_cb;
+ req.msgIdMaxCount = msg_id_max_cnt;
+ req.msgIdRangeCount = msg_id_range_cnt;
+
+ inner_gv = g_variant_get_variant(arg_mdgId);
+ g_variant_get(inner_gv, "aa{sv}", &iter);
+ while (g_variant_iter_next(iter, "a{sv}", &iter_row)) {
+ while (g_variant_iter_loop(iter_row, "{sv}", &key, &value)) {
+ if (!g_strcmp0(key, "FromMsgId"))
+ req.msgIDs[i].net3gpp.fromMsgId = g_variant_get_uint16(value);
+ else if (!g_strcmp0(key, "ToMsgId"))
+ req.msgIDs[i].net3gpp.toMsgId = g_variant_get_uint16(value);
+ else if (!g_strcmp0(key, "CBCategory"))
+ req.msgIDs[i].net3gpp2.cbCategory = g_variant_get_uint16(value);
+ else if (!g_strcmp0(key, "CBLanguage"))
+ req.msgIDs[i].net3gpp2.cbLanguage = g_variant_get_uint16(value);
+ else if (!g_strcmp0(key, "Selected"))
+ req.msgIDs[i].net3gpp2.selected = g_variant_get_byte(value);
+ }
+ g_variant_iter_free(iter_row);
+
+ i++;
+ if (i >= SMS_GSM_SMS_CBMI_LIST_SIZE_MAX)
+ break;
+ }
+ g_variant_iter_free(iter);
+ g_variant_unref(inner_gv);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sms, invocation,
+ TREQ_SMS_SET_CB_CONFIG,
+ &req, sizeof(struct treq_sms_set_cb_config));
+
+ return TRUE;
+}
+
+static gboolean on_sms_set_mem_status(TelephonySms *sms,
+ GDBusMethodInvocation *invocation,
+ gint memory_status, gpointer user_data)
+{
+ struct treq_sms_set_mem_status req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_SMS, "w"))
+ return TRUE;
+
+ req.memory_status = memory_status;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sms, invocation,
+ TREQ_SMS_SET_MEM_STATUS,
+ &req, sizeof(struct treq_sms_set_mem_status));
+
+ return TRUE;
+}
+
+static gboolean on_sms_get_pref_bearer(TelephonySms *sms,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_SMS, "r"))
+ return TRUE;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sms, invocation,
+ TREQ_SMS_GET_PREF_BEARER,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_sms_set_pref_bearer(TelephonySms *sms,
+ GDBusMethodInvocation *invocation,
+ gint bearer_type, gpointer user_data)
+{
+ struct treq_sms_set_pref_bearer req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_SMS, "w"))
+ return TRUE;
+
+ req.svc = bearer_type;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sms, invocation,
+ TREQ_SMS_SET_PREF_BEARER,
+ &req, sizeof(struct treq_sms_set_pref_bearer));
+
+ return TRUE;
+}
+
+static gboolean on_sms_set_delivery_report(TelephonySms *sms,
+ GDBusMethodInvocation *invocation,
+ gint format, const gchar *sca,
+ gint tpdu_length, const gchar *tpdu_data,
+ gint rp_cause, gpointer user_data)
+{
+ struct treq_sms_set_delivery_report req;
+ struct custom_data *ctx = user_data;
+
+ guchar *decoded_sca = NULL;
+ guchar *decoded_tpdu = NULL;
+
+ gsize decoded_sca_len = 0;
+ gsize decoded_tpdu_len = 0;
+
+ if (!check_access_control(invocation, AC_SMS, "w"))
+ return TRUE;
+
+ memset(&req, 0, sizeof(struct treq_sms_set_delivery_report));
+
+ if (SMS_NETTYPE_3GPP == format) {
+ req.dataInfo.format = SMS_NETTYPE_3GPP;
+ } else if (SMS_NETTYPE_3GPP2 == format) {
+ req.dataInfo.format = SMS_NETTYPE_3GPP2;
+ } else {
+ err("Invalid Format Received:[%d]", format);
+
+ FAIL_RESPONSE(invocation, DEFAULT_MSG_REQ_FAILED);
+
+ return TRUE;
+ }
+
+ decoded_sca = g_base64_decode(sca, &decoded_sca_len);
+ if (NULL == decoded_sca) {
+ warn("g_base64_decode: Failed to decode sca");
+
+ FAIL_RESPONSE(invocation, DEFAULT_MSG_REQ_FAILED);
+
+ return TRUE;
+ } else if (decoded_sca_len > SMS_SMSP_ADDRESS_LEN) {
+ err("Invalid Sca length");
+
+ FAIL_RESPONSE(invocation, DEFAULT_MSG_REQ_FAILED);
+
+ goto EXIT;
+ }
+ memcpy(req.dataInfo.sca, decoded_sca, decoded_sca_len);
+
+ decoded_tpdu = g_base64_decode(tpdu_data, &decoded_tpdu_len);
+ if (NULL == decoded_tpdu) {
+ warn("g_base64_decode: Failed to decode tpdu");
+ FAIL_RESPONSE(invocation, DEFAULT_MSG_REQ_FAILED);
+ goto EXIT;
+ } else if (decoded_tpdu_len > SMS_SMDATA_SIZE_MAX+1) {
+ err("Invalid tpdu length");
+
+ FAIL_RESPONSE(invocation, DEFAULT_MSG_REQ_FAILED);
+
+ goto EXIT;
+ }
+ memcpy(req.dataInfo.tpduData, decoded_tpdu, decoded_tpdu_len);
+
+ info("[%s] Decoded SCA len: [%d] TPDU len: [%d]", GET_CP_NAME(invocation),
+ decoded_sca_len, decoded_tpdu_len);
+
+ req.dataInfo.msgLength = tpdu_length;
+ req.rspType = rp_cause;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sms, invocation,
+ TREQ_SMS_SET_DELIVERY_REPORT,
+ &req, sizeof(struct treq_sms_set_delivery_report));
+
+EXIT:
+ g_free(decoded_sca);
+ g_free(decoded_tpdu);
+
+ return TRUE;
+}
+
+static gboolean on_sms_set_msg_status(TelephonySms *sms,
+ GDBusMethodInvocation *invocation,
+ gint msg_index, gint msg_status, gpointer user_data)
+{
+ struct treq_sms_set_msg_status req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_SMS, "w"))
+ return TRUE;
+
+ req.index = msg_index;
+ req.msgStatus = msg_status;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sms, invocation,
+ TREQ_SMS_SET_MSG_STATUS,
+ &req, sizeof(struct treq_sms_set_msg_status));
+
+ return TRUE;
+}
+
+static gboolean on_sms_get_sms_params(TelephonySms *sms,
+ GDBusMethodInvocation *invocation,
+ gint msg_index, gpointer user_data)
+{
+ struct treq_sms_get_params req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_SMS, "r"))
+ return TRUE;
+
+ req.index = msg_index;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sms, invocation,
+ TREQ_SMS_GET_PARAMS,
+ &req, sizeof(struct treq_sms_get_params));
+
+ return TRUE;
+}
+
+static gboolean on_sms_set_sms_params(TelephonySms *sms,
+ GDBusMethodInvocation *invocation,
+ gint record_index, gint record_len,
+ gint alpha_id_len, GVariant *alpha_id,
+ gint param_indicator,
+ gint dial_num_len, gint dial_num_ton, gint dial_num_npi, GVariant *dial_num,
+ gint sca_len, gint sca_ton, gint sca_npi, GVariant *sca,
+ gint protocol_id, gint dcs, gint validity_period,
+ gpointer user_data)
+{
+ struct treq_sms_set_params req;
+ struct custom_data *ctx = user_data;
+
+ int i = 0;
+ GVariantIter *iter = NULL;
+ GVariant *inner_gv = NULL;
+
+ if (!check_access_control(invocation, AC_SMS, "w"))
+ return TRUE;
+
+ memset(&req, 0x0, sizeof(struct treq_sms_set_params));
+
+ req.params.recordIndex = record_index;
+ req.params.recordLen = record_len;
+ req.params.alphaIdLen = alpha_id_len;
+
+ inner_gv = g_variant_get_variant(alpha_id);
+ g_variant_get(inner_gv, "ay", &iter);
+ while (g_variant_iter_loop(iter, "y", &req.params.szAlphaId[i])) {
+ i++;
+ if (i >= SMS_SMSP_ALPHA_ID_LEN_MAX + 1)
+ break;
+ }
+ g_variant_iter_free(iter);
+ g_variant_unref(inner_gv);
+
+ req.params.paramIndicator = param_indicator;
+ req.params.tpDestAddr.dialNumLen = dial_num_len;
+ req.params.tpDestAddr.typeOfNum = dial_num_ton;
+ req.params.tpDestAddr.numPlanId = dial_num_npi;
+
+ i = 0;
+ inner_gv = g_variant_get_variant(dial_num);
+ g_variant_get(inner_gv, "ay", &iter);
+ while (g_variant_iter_loop(iter, "y", &req.params.tpDestAddr.diallingNum[i])) {
+ i++;
+ if (i >= SMS_SMSP_ADDRESS_LEN + 1)
+ break;
+ }
+ g_variant_iter_free(iter);
+ g_variant_unref(inner_gv);
+
+ req.params.tpSvcCntrAddr.dialNumLen = sca_len;
+ req.params.tpSvcCntrAddr.typeOfNum = sca_ton;
+ req.params.tpSvcCntrAddr.numPlanId = sca_npi;
+
+ i = 0;
+ inner_gv = g_variant_get_variant(sca);
+ g_variant_get(inner_gv, "ay", &iter);
+ while (g_variant_iter_loop(iter, "y", &req.params.tpSvcCntrAddr.diallingNum[i])) {
+ i++;
+ if (i >= SMS_SMSP_ADDRESS_LEN + 1)
+ break;
+ }
+ g_variant_iter_free(iter);
+ g_variant_unref(inner_gv);
+
+ req.params.tpProtocolId = protocol_id;
+ req.params.tpDataCodingScheme = dcs;
+ req.params.tpValidityPeriod = validity_period;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sms, invocation,
+ TREQ_SMS_SET_PARAMS,
+ &req, sizeof(struct treq_sms_set_params));
+
+ return TRUE;
+}
+
+static gboolean on_sms_get_sms_param_cnt(TelephonySms *sms,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_SMS, "r"))
+ return TRUE;
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, sms, invocation,
+ TREQ_SMS_GET_PARAMCNT,
+ NULL, 0);
+
+ return TRUE;
+}
+
+static gboolean on_sms_get_sms_ready_status(TelephonySms *sms,
+ GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ struct custom_data *ctx = user_data;
+ CoreObject *co_sms = NULL;
+ TcorePlugin *plugin = NULL;
+ gboolean ready_status = FALSE;
+
+ if (!check_access_control(invocation, AC_SMS, "r"))
+ return TRUE;
+
+ plugin = tcore_server_find_plugin(ctx->server, GET_CP_NAME(invocation));
+ co_sms = tcore_plugin_ref_core_object(plugin, CORE_OBJECT_TYPE_SMS);
+ if (!co_sms) {
+ err("co_sms is NULL");
+
+ FAIL_RESPONSE(invocation, DEFAULT_MSG_REQ_FAILED);
+
+ return TRUE;
+ }
+
+ ready_status = tcore_sms_get_ready_status(co_sms);
+ dbg("[%s] ready_status = %d", GET_CP_NAME(invocation), ready_status);
+
+ telephony_sms_complete_get_sms_ready_status(sms, invocation, ready_status);
+
+ return TRUE;
+}
+
+gboolean dbus_plugin_setup_sms_interface(TelephonyObjectSkeleton *object,
+ struct custom_data *ctx)
+{
+ TelephonySms *sms;
+
+ sms = telephony_sms_skeleton_new();
+ telephony_object_skeleton_set_sms(object, sms);
+ g_object_unref(sms);
+
+ dbg("sms = %p", sms);
+
+ /*
+ * Register signal handlers for SMS interface
+ */
+ g_signal_connect(sms,
+ "handle-send-msg",
+ G_CALLBACK(on_sms_send_msg), ctx);
+
+ g_signal_connect(sms,
+ "handle-read-msg",
+ G_CALLBACK(on_sms_read_msg), ctx);
+
+ g_signal_connect(sms,
+ "handle-save-msg",
+ G_CALLBACK(on_sms_save_msg), ctx);
+
+ g_signal_connect(sms,
+ "handle-delete-msg",
+ G_CALLBACK(on_sms_delete_msg), ctx);
+
+ g_signal_connect(sms,
+ "handle-get-msg-count",
+ G_CALLBACK(on_sms_get_msg_count), ctx);
+
+ g_signal_connect(sms,
+ "handle-get-sca",
+ G_CALLBACK(on_sms_get_sca), ctx);
+
+ g_signal_connect(sms,
+ "handle-set-sca",
+ G_CALLBACK(on_sms_set_sca), ctx);
+
+ g_signal_connect(sms,
+ "handle-get-cb-config",
+ G_CALLBACK(on_sms_get_cb_config), ctx);
+
+ g_signal_connect(sms,
+ "handle-set-cb-config",
+ G_CALLBACK(on_sms_set_cb_config), ctx);
+
+ g_signal_connect(sms,
+ "handle-set-mem-status",
+ G_CALLBACK(on_sms_set_mem_status), ctx);
+
+ g_signal_connect(sms,
+ "handle-get-pref-bearer",
+ G_CALLBACK(on_sms_get_pref_bearer), ctx);
+
+ g_signal_connect(sms,
+ "handle-set-pref-bearer",
+ G_CALLBACK(on_sms_set_pref_bearer), ctx);
+
+ g_signal_connect(sms,
+ "handle-set-delivery-report",
+ G_CALLBACK(on_sms_set_delivery_report), ctx);
+
+ g_signal_connect(sms,
+ "handle-set-msg-status",
+ G_CALLBACK(on_sms_set_msg_status), ctx);
+
+ g_signal_connect(sms,
+ "handle-get-sms-params",
+ G_CALLBACK(on_sms_get_sms_params), ctx);
+
+ g_signal_connect(sms,
+ "handle-set-sms-params",
+ G_CALLBACK(on_sms_set_sms_params), ctx);
+
+ g_signal_connect(sms,
+ "handle-get-sms-param-cnt",
+ G_CALLBACK(on_sms_get_sms_param_cnt), ctx);
+
+ g_signal_connect(sms,
+ "handle-get-sms-ready-status",
+ G_CALLBACK(on_sms_get_sms_ready_status), ctx);
+
+ return TRUE;
+}
+
+gboolean dbus_plugin_sms_response(struct custom_data *ctx,
+ UserRequest *ur, struct dbus_request_info *dbus_info,
+ enum tcore_response_command command, unsigned int data_len, const void *data)
+{
+ char *cpname = dbus_info ? GET_CP_NAME(dbus_info->invocation) : "";
+
+ switch (command) {
+ case TRESP_SMS_SEND_UMTS_MSG: {
+ const struct tresp_sms_send_msg *resp = data;
+
+ dbg("[%s] SEND_UMTS_MSG (result:[0x%x])", cpname, resp->result);
+
+ telephony_sms_complete_send_msg(dbus_info->interface_object,
+ dbus_info->invocation, resp->result);
+ }
+ break;
+
+ case TRESP_SMS_SEND_CDMA_MSG: {
+ const struct tresp_sms_send_msg *resp = data;
+
+ dbg("[%s] SEND_CDMA_MSG (result:[0x%x])", cpname, resp->result);
+
+ telephony_sms_complete_send_msg(dbus_info->interface_object,
+ dbus_info->invocation, resp->result);
+ }
+ break;
+
+ case TRESP_SMS_READ_MSG: {
+ const struct tresp_sms_read_msg *resp = data;
+ GVariant *sca = NULL, *packet_sca = NULL;
+ GVariant *tpdu = NULL, *packet_tpdu = NULL;
+ GVariantBuilder b;
+ unsigned int i;
+
+ dbg("[%s] READ_MSG (result:[0x%x])", cpname, resp->result);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("ay"));
+ for (i = 0; i < SMS_SMSP_ADDRESS_LEN; i++)
+ g_variant_builder_add(&b, "y", resp->dataInfo.smsData.sca[i]);
+ sca = g_variant_builder_end(&b);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("ay"));
+ for (i = 0; i < SMS_SMDATA_SIZE_MAX + 1; i++)
+ g_variant_builder_add(&b, "y", resp->dataInfo.smsData.tpduData[i]);
+ tpdu = g_variant_builder_end(&b);
+
+ packet_sca = g_variant_new("v", sca);
+ packet_tpdu = g_variant_new("v", tpdu);
+
+ telephony_sms_complete_read_msg(dbus_info->interface_object,
+ dbus_info->invocation, resp->result,
+ resp->dataInfo.simIndex, resp->dataInfo.msgStatus,
+ resp->dataInfo.smsData.format,
+ packet_sca,
+ resp->dataInfo.smsData.msgLength,
+ packet_tpdu);
+ }
+ break;
+
+ case TRESP_SMS_SAVE_MSG: {
+ const struct tresp_sms_save_msg *resp = data;
+
+ dbg("[%s] SAVE_MSG (index:[%d] result:[0x%x])", cpname, resp->index, resp->result);
+
+ telephony_sms_complete_save_msg(dbus_info->interface_object,
+ dbus_info->invocation, resp->result, resp->index);
+ }
+ break;
+
+ case TRESP_SMS_DELETE_MSG: {
+ const struct tresp_sms_delete_msg *resp = data;
+
+ dbg("[%s] DELETE_MSG (index:[%d] result:[0x%x])", cpname, resp->index, resp->result);
+
+ telephony_sms_complete_delete_msg(dbus_info->interface_object,
+ dbus_info->invocation, resp->result, resp->index);
+ }
+ break;
+
+ case TRESP_SMS_GET_STORED_MSG_COUNT: {
+ const struct tresp_sms_get_storedMsgCnt *resp = data;
+ GVariant *list;
+ GVariantBuilder b;
+ unsigned int i;
+
+ dbg("[%s] GET_STORED_MSG_COUNT (result:[0x%x])", cpname, resp->result);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("ai"));
+ for (i = 0; i < resp->storedMsgCnt.totalCount; i++)
+ g_variant_builder_add(&b, "i", resp->storedMsgCnt.indexList[i]);
+ list = g_variant_builder_end(&b);
+
+ telephony_sms_complete_get_msg_count(dbus_info->interface_object,
+ dbus_info->invocation, resp->result,
+ resp->storedMsgCnt.totalCount,
+ resp->storedMsgCnt.usedCount,
+ list);
+ }
+ break;
+
+ case TRESP_SMS_GET_SCA: {
+ const struct tresp_sms_get_sca *resp = data;
+ GVariant *sca = NULL, *packet_sca = NULL;
+ GVariantBuilder b;
+ unsigned int i;
+
+ dbg("[%s] GET_SCA (result:[0x%x])", cpname, resp->result);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("ay"));
+ for (i = 0; i < SMS_SMSP_ADDRESS_LEN + 1; i++)
+ g_variant_builder_add(&b, "y", resp->scaAddress.diallingNum[i]);
+ sca = g_variant_builder_end(&b);
+
+ packet_sca = g_variant_new("v", sca);
+
+ telephony_sms_complete_get_sca(dbus_info->interface_object,
+ dbus_info->invocation, resp->result,
+ resp->scaAddress.typeOfNum,
+ resp->scaAddress.numPlanId,
+ resp->scaAddress.dialNumLen,
+ packet_sca);
+ }
+ break;
+
+ case TRESP_SMS_SET_SCA: {
+ const struct tresp_sms_set_sca *resp = data;
+
+ dbg("[%s] SET_SCA (result:[0x%x])", cpname, resp->result);
+
+ telephony_sms_complete_set_sca(dbus_info->interface_object, dbus_info->invocation,
+ resp->result);
+ }
+ break;
+
+ case TRESP_SMS_GET_CB_CONFIG: {
+ const struct tresp_sms_get_cb_config *resp = data;
+ GVariant *result = NULL;
+ GVariantBuilder b;
+ int i;
+
+ dbg("[%s] GET_CB_CONFIG (result:[0x%x])", cpname, resp->result);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+ for (i = 0; i < resp->cbConfig.msgIdRangeCount; i++) {
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+
+ if (resp->cbConfig.net3gppType == SMS_NETTYPE_3GPP) {
+ g_variant_builder_add(&b, "{sv}", "FromMsgId",
+ g_variant_new_uint16(resp->cbConfig.msgIDs[i].net3gpp.fromMsgId));
+ g_variant_builder_add(&b, "{sv}", "ToMsgId",
+ g_variant_new_uint16(resp->cbConfig.msgIDs[i].net3gpp.toMsgId));
+ } else if (resp->cbConfig.net3gppType == SMS_NETTYPE_3GPP2) {
+ g_variant_builder_add(&b, "{sv}", "CBCategory",
+ g_variant_new_uint16(resp->cbConfig.msgIDs[i].net3gpp2.cbCategory));
+ g_variant_builder_add(&b, "{sv}", "CBLanguage",
+ g_variant_new_uint16(resp->cbConfig.msgIDs[i].net3gpp2.cbLanguage));
+ } else {
+ dbg("Unknown 3gpp type");
+ return FALSE;
+ }
+
+ g_variant_builder_add(&b, "{sv}", "Selected",
+ g_variant_new_byte(resp->cbConfig.msgIDs[i].net3gpp.selected));
+ g_variant_builder_close(&b);
+ }
+ result = g_variant_builder_end(&b);
+
+ telephony_sms_complete_get_cb_config(dbus_info->interface_object,
+ dbus_info->invocation, resp->result,
+ resp->cbConfig.net3gppType,
+ resp->cbConfig.cbEnabled,
+ resp->cbConfig.msgIdMaxCount,
+ resp->cbConfig.msgIdRangeCount,
+ result);
+ }
+ break;
+
+ case TRESP_SMS_SET_CB_CONFIG: {
+ const struct tresp_sms_set_cb_config *resp = data;
+
+ dbg("[%s] SET_CB_CONFIG (result:[0x%x])", cpname, resp->result);
+
+ telephony_sms_complete_set_cb_config(dbus_info->interface_object,
+ dbus_info->invocation, resp->result);
+ }
+ break;
+
+ case TRESP_SMS_SET_MEM_STATUS: {
+ const struct tresp_sms_set_mem_status *resp = data;
+
+ dbg("[%s] SET_MEM_STATUS (result:[0x%x])", cpname, resp->result);
+
+ telephony_sms_complete_set_mem_status(dbus_info->interface_object,
+ dbus_info->invocation, resp->result);
+ }
+ break;
+
+ case TRESP_SMS_GET_PREF_BEARER: {
+ const struct tresp_sms_get_pref_bearer *resp = data;
+
+ dbg("[%s] GET_PREF_BEARER (result:[0x%x] svc:[0x%2x])", cpname, resp->result, resp->svc);
+
+ telephony_sms_complete_get_pref_bearer(dbus_info->interface_object,
+ dbus_info->invocation, resp->result, resp->svc);
+ }
+ break;
+
+ case TRESP_SMS_SET_PREF_BEARER: {
+ const struct tresp_sms_set_pref_bearer *resp = data;
+
+ dbg("[%s] SET_PREF_BEARER (result:[0x%x])", cpname, resp->result);
+
+ telephony_sms_complete_set_pref_bearer(dbus_info->interface_object,
+ dbus_info->invocation, resp->result);
+ }
+ break;
+
+ case TRESP_SMS_SET_DELIVERY_REPORT: {
+ const struct tresp_sms_set_delivery_report *resp = data;
+
+ dbg("[%s] SET_DELIVERY_REPORT (result:[0x%x])", cpname, resp->result);
+
+ telephony_sms_complete_set_delivery_report(dbus_info->interface_object,
+ dbus_info->invocation, resp->result);
+ }
+ break;
+
+ case TRESP_SMS_SET_MSG_STATUS: {
+ const struct tresp_sms_set_mem_status *resp = data;
+
+ dbg("[%s] SET_MSG_STATUS (result:[0x%x])", cpname, resp->result);
+
+ telephony_sms_complete_set_msg_status(dbus_info->interface_object,
+ dbus_info->invocation, resp->result);
+ }
+ break;
+
+ case TRESP_SMS_GET_PARAMS: {
+ const struct tresp_sms_get_params *resp = data;
+ GVariant *alphaId = NULL, *packet_alphaId = NULL;
+ GVariant *destDialNum = NULL, *packet_destDialNum = NULL;
+ GVariant *scaDialNum = NULL, *packet_scaDialNum = NULL;
+ GVariantBuilder b;
+ unsigned int i;
+
+ dbg("[%s] GET_PARAMS (result:[0x%x])", cpname, resp->result);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("ay"));
+ for (i = 0; i < SMS_SMSP_ALPHA_ID_LEN_MAX + 1; i++)
+ g_variant_builder_add(&b, "y", resp->paramsInfo.szAlphaId[i]);
+ alphaId = g_variant_builder_end(&b);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("ay"));
+ for (i = 0; i < SMS_SMSP_ADDRESS_LEN + 1; i++)
+ g_variant_builder_add(&b, "y", resp->paramsInfo.tpDestAddr.diallingNum[i]);
+ destDialNum = g_variant_builder_end(&b);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("ay"));
+ for (i = 0; i < SMS_SMSP_ADDRESS_LEN + 1; i++)
+ g_variant_builder_add(&b, "y", resp->paramsInfo.tpSvcCntrAddr.diallingNum[i]);
+ scaDialNum = g_variant_builder_end(&b);
+
+ packet_alphaId = g_variant_new("v", alphaId);
+ packet_destDialNum = g_variant_new("v", destDialNum);
+ packet_scaDialNum = g_variant_new("v", scaDialNum);
+
+ telephony_sms_complete_get_sms_params(dbus_info->interface_object,
+ dbus_info->invocation, resp->result,
+ resp->paramsInfo.recordIndex,
+ resp->paramsInfo.recordLen,
+ resp->paramsInfo.alphaIdLen,
+ packet_alphaId,
+ resp->paramsInfo.paramIndicator,
+ resp->paramsInfo.tpDestAddr.dialNumLen,
+ resp->paramsInfo.tpDestAddr.typeOfNum,
+ resp->paramsInfo.tpDestAddr.numPlanId,
+ packet_destDialNum,
+ resp->paramsInfo.tpSvcCntrAddr.dialNumLen,
+ resp->paramsInfo.tpSvcCntrAddr.typeOfNum,
+ resp->paramsInfo.tpSvcCntrAddr.numPlanId,
+ packet_scaDialNum,
+ resp->paramsInfo.tpProtocolId,
+ resp->paramsInfo.tpDataCodingScheme,
+ resp->paramsInfo.tpValidityPeriod);
+ }
+ break;
+
+ case TRESP_SMS_SET_PARAMS:{
+ const struct tresp_sms_set_params *resp = data;
+
+ dbg("[%s] SET_PARAMS (result:[0x%x])", cpname, resp->result);
+
+ telephony_sms_complete_set_sms_params(dbus_info->interface_object,
+ dbus_info->invocation, resp->result);
+ }
+ break;
+
+ case TRESP_SMS_GET_PARAMCNT: {
+ const struct tresp_sms_get_paramcnt *resp = data;
+
+ dbg("[%s] GET_PARAMCNT (result:[0x%x])", cpname, resp->result);
+
+ telephony_sms_complete_get_sms_param_cnt(dbus_info->interface_object,
+ dbus_info->invocation, resp->result, resp->recordCount);
+ }
+ break;
+
+ default:
+ err("Unhandled/Unknown Response: [0x%x]", command);
+ break;
+ }
+
+ return TRUE;
+}
+
+gboolean dbus_plugin_sms_notification(struct custom_data *ctx,
+ CoreObject *source, TelephonyObjectSkeleton *object,
+ enum tcore_notification_command command, unsigned int data_len, const void *data)
+{
+ TelephonySms *sms;
+ const char *cp_name;
+
+ if (!object) {
+ warn("object is NULL");
+ return FALSE;
+ }
+
+ cp_name = tcore_server_get_cp_name_by_plugin(tcore_object_ref_plugin(source));
+
+ sms = telephony_object_peek_sms(TELEPHONY_OBJECT(object));
+ if (sms == NULL) {
+ err("sms object is NULL!!!");
+ return FALSE;
+ }
+
+ switch (command) {
+ case TNOTI_SMS_INCOM_MSG: {
+ const struct tnoti_sms_incoming_msg *noti = data;
+ gchar *sca = NULL;
+ gchar *tpdu = NULL;
+
+ info("[%s] SMS_INCOM_MSG (len[%d])", cp_name, data_len);
+
+ sca = g_base64_encode((const guchar *)(noti->msgInfo.sca), SMS_SMSP_ADDRESS_LEN);
+ tpdu = g_base64_encode((const guchar *)(noti->msgInfo.tpduData), SMS_SMDATA_SIZE_MAX + 1);
+
+ telephony_sms_emit_incomming_msg(sms,
+ noti->msgInfo.format,
+ sca,
+ noti->msgInfo.msgLength,
+ tpdu);
+
+ g_free(sca);
+ g_free(tpdu);
+ }
+ break;
+
+ case TNOTI_SMS_CB_INCOM_MSG: {
+ const struct tnoti_sms_cellBroadcast_msg *noti = data;
+ gchar *tpdu = NULL;
+
+ info("[%s] SMS_CB_INCOM_MSG (len[%d])", cp_name, data_len);
+
+ tpdu = g_base64_encode((const guchar*)(noti->cbMsg.msgData), SMS_CB_SIZE_MAX+1);
+
+ telephony_sms_emit_incomming_cb_msg(sms,
+ noti->cbMsg.cbMsgType,
+ noti->cbMsg.length,
+ tpdu);
+
+ g_free(tpdu);
+ }
+ break;
+
+ case TNOTI_SMS_ETWS_INCOM_MSG: {
+ const struct tnoti_sms_etws_msg *noti = data;
+ GVariant *msg_data = NULL, *packet_msg_data = NULL;
+ GVariantBuilder b;
+ unsigned int i;
+
+ info("[%s] ETWS_INCOM_MSG (len[%d])", cp_name, data_len);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("ay"));
+
+ for (i = 0; i < SMS_ETWS_SIZE_MAX + 1; i++)
+ g_variant_builder_add(&b, "y", noti->etwsMsg.msgData[i]);
+ msg_data = g_variant_builder_end(&b);
+ packet_msg_data = g_variant_new("v", msg_data);
+
+ telephony_sms_emit_incomming_etws_msg(sms,
+ noti->etwsMsg.etwsMsgType,
+ noti->etwsMsg.length,
+ packet_msg_data);
+ }
+ break;
+
+ case TNOTI_SMS_INCOM_EX_MSG: {
+ info("[%s] SMS_INCOM_EX_MSG (len[%d])", cp_name, data_len);
+ }
+ break;
+
+ case TNOTI_SMS_CB_INCOM_EX_MSG: {
+ info("[%s] CB_INCOM_EX_MSG (len[%d])", cp_name, data_len);
+ }
+ break;
+
+ case TNOTI_SMS_MEMORY_STATUS: {
+ const struct tnoti_sms_memory_status *noti = data;
+
+ info("[%s] SMS_MEMORY_STATUS (%d)", cp_name, noti->status);
+
+ telephony_sms_emit_memory_status(sms, noti->status);
+ }
+ break;
+
+ case TNOTI_SMS_DEVICE_READY: {
+ const struct tnoti_sms_ready_status *noti = data;
+
+ info("[%s] SMS_DEVICE_READY (%d)", cp_name, noti->status);
+
+#ifdef ENABLE_KPI_LOGS
+ if (noti->status != SMS_READY_STATUS_NONE)
+ TIME_CHECK("[%s] SMS Service Ready", cp_name);
+#endif
+
+ telephony_sms_emit_sms_ready(sms, noti->status);
+ }
+ break;
+
+ default:
+ err("Unhandled/Unknown Notification: [0x%x]", command);
+ break;
+ }
+
+ return TRUE;
+}
--- /dev/null
+/*
+ * tel-plugin-dbus-tapi
+ *
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Ja-young Gu <jygu@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <glib.h>
+
+#include <appsvc.h>
+#include <bundle_internal.h>
+
+#include <tcore.h>
+#include <server.h>
+#include <plugin.h>
+#include <co_ss.h>
+
+#include "generated-code.h"
+#include "dtapi_common.h"
+
+/*
+ * CISS application package name
+ */
+#define CISS_APP "org.tizen.ciss"
+
+typedef struct {
+ int status;
+ int dcs;
+ int length;
+ char data[MAX_SS_USSD_LEN];
+} CissDataType;
+
+typedef struct {
+ int err;
+ int ss_type;
+} CissInformation;
+
+static void __launch_ciss_information(const struct tnoti_ss_information *ss_info, enum dbus_tapi_sim_slot_id slot_id)
+{
+ gchar *encoded_data;
+ CissInformation ciss_inform;
+ char slot_info[2] = {0,};
+
+ bundle *kb = NULL;
+
+ memset(&ciss_inform, 0x0, sizeof(CissInformation));
+ ciss_inform.err = ss_info->err;
+ ciss_inform.ss_type = ss_info->ss_type;
+
+ snprintf(slot_info, 2, "%d", slot_id);
+ dbg("slot_id : [%s]", slot_info);
+
+ dbg("Explicit launch CISS application by appsvc");
+
+ kb = bundle_create();
+ if (!kb) {
+ warn("bundle_create() failed");
+ return;
+ }
+
+ appsvc_set_pkgname(kb, CISS_APP);
+
+ encoded_data = g_base64_encode((guchar *)&ciss_inform, sizeof(CissInformation));
+
+ appsvc_add_data(kb, "CISS_LAUNCHING_MODE", "RESP");
+ appsvc_add_data(kb, "KEY_EVENT_TYPE", "200");
+ appsvc_add_data(kb, "KEY_ENCODED_DATA", encoded_data);
+ appsvc_add_data(kb, "KEY_SLOT_ID", slot_info);
+
+ dbg("CISS appsvc run!");
+ appsvc_run_service(kb, 0, NULL, NULL);
+
+ bundle_free(kb);
+ g_free(encoded_data);
+}
+
+static void __launch_ciss(const struct tnoti_ss_ussd *ussd, enum dbus_tapi_sim_slot_id slot_id)
+{
+ gchar *encoded_data;
+ CissDataType ciss_data;
+ char slot_info[2] = {0,};
+
+ bundle *kb = NULL;
+
+ memset(&ciss_data, 0x0, sizeof(CissDataType));
+ ciss_data.status = ussd->dcs;
+ ciss_data.status = ussd->status;
+ ciss_data.length = ussd->len;
+ memcpy(ciss_data.data, ussd->str, ciss_data.length);
+
+ snprintf(slot_info, 2, "%d", slot_id);
+ dbg("slot_id : [%s]", slot_info);
+
+ dbg("Explicit launch CISS application by appsvc");
+
+ kb = bundle_create();
+ if (!kb) {
+ warn("bundle_create() failed");
+ return;
+ }
+
+ appsvc_set_pkgname(kb, CISS_APP);
+
+ encoded_data = g_base64_encode((guchar *)&ciss_data, sizeof(CissDataType));
+
+ appsvc_add_data(kb, "CISS_LAUNCHING_MODE", "RESP");
+ appsvc_add_data(kb, "KEY_EVENT_TYPE", "100");
+ appsvc_add_data(kb, "KEY_ENCODED_DATA", encoded_data);
+ appsvc_add_data(kb, "KEY_SLOT_ID", slot_info);
+
+ dbg("CISS appsvc run!");
+ appsvc_run_service(kb, 0, NULL, NULL);
+
+ bundle_free(kb);
+ g_free(encoded_data);
+}
+
+static gboolean on_ss_activate_barring(TelephonySs *ss,
+ GDBusMethodInvocation *invocation,
+ gint ss_class,
+ gint barring_mode, const gchar *barring_password,
+ gpointer user_data)
+{
+ struct treq_ss_barring req;
+ struct custom_data *ctx = user_data;
+ char buf[MAX_SS_BARRING_PASSWORD_LEN + 1];
+
+ if (!check_access_control(invocation, AC_SS, "x"))
+ return TRUE;
+
+ memset(&req, 0x0, sizeof(struct treq_ss_barring));
+
+ req.class = ss_class;
+ req.mode = barring_mode;
+
+ memcpy(req.password, barring_password, MAX_SS_BARRING_PASSWORD_LEN);
+
+ memcpy(buf, barring_password, MAX_SS_BARRING_PASSWORD_LEN);
+ buf[MAX_SS_BARRING_PASSWORD_LEN] = '\0';
+ dbg("Class: [%d] Barring - mode: [%d] password: [%s]",
+ req.class, req.mode, buf);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, ss, invocation,
+ TREQ_SS_BARRING_ACTIVATE,
+ &req, sizeof(struct treq_ss_barring));
+
+ return TRUE;
+}
+
+static gboolean on_ss_deactivate_barring(TelephonySs *ss,
+ GDBusMethodInvocation *invocation,
+ gint ss_class,
+ gint barring_mode, const gchar *barring_password,
+ gpointer user_data)
+{
+ struct treq_ss_barring req;
+ struct custom_data *ctx = user_data;
+ char buf[MAX_SS_BARRING_PASSWORD_LEN + 1];
+
+ if (!check_access_control(invocation, AC_SS, "x"))
+ return TRUE;
+
+ memset(&req, 0x0, sizeof(struct treq_ss_barring));
+
+ req.class = ss_class;
+ req.mode = barring_mode;
+
+ memcpy(req.password, barring_password, MAX_SS_BARRING_PASSWORD_LEN);
+
+ memcpy(buf, barring_password, MAX_SS_BARRING_PASSWORD_LEN);
+ buf[MAX_SS_BARRING_PASSWORD_LEN] = '\0';
+ dbg("Class: [%d] Barring - mode: [%d] password: [%s]",
+ req.class, req.mode, buf);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, ss, invocation,
+ TREQ_SS_BARRING_DEACTIVATE,
+ &req, sizeof(struct treq_ss_barring));
+
+ return TRUE;
+}
+
+static gboolean on_ss_change_barring_password(TelephonySs *ss,
+ GDBusMethodInvocation *invocation,
+ const gchar *barring_password,
+ const gchar *barring_password_new,
+ const gchar *barring_password_confirm,
+ gpointer user_data)
+{
+ struct treq_ss_barring_change_password req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_SS, "x"))
+ return TRUE;
+
+ memset(&req, 0x0, sizeof(struct treq_ss_barring_change_password));
+
+ memcpy(req.password_old, barring_password, MAX_SS_BARRING_PASSWORD_LEN);
+ memcpy(req.password_new, barring_password_new, MAX_SS_BARRING_PASSWORD_LEN);
+ memcpy(req.password_confirm, barring_password_confirm, MAX_SS_BARRING_PASSWORD_LEN);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, ss, invocation,
+ TREQ_SS_BARRING_CHANGE_PASSWORD,
+ &req, sizeof(struct treq_ss_barring_change_password));
+
+ return TRUE;
+}
+
+static gboolean on_ss_get_barring_status(TelephonySs *ss,
+ GDBusMethodInvocation *invocation,
+ gint ss_class, gint barring_mode,
+ gpointer user_data)
+{
+ struct treq_ss_barring req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_SS, "r"))
+ return TRUE;
+
+ memset(&req, 0x0, sizeof(struct treq_ss_barring));
+
+ req.class = ss_class;
+ req.mode = barring_mode;
+
+ dbg("Class: [%d] Barring mode: [%d]", req.class, req.mode);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, ss, invocation,
+ TREQ_SS_BARRING_GET_STATUS,
+ &req, sizeof(struct treq_ss_barring));
+
+ return TRUE;
+}
+
+static gboolean on_ss_register_forwarding(TelephonySs *ss,
+ GDBusMethodInvocation *invocation,
+ gint ss_class,
+ gint forward_mode,
+ gint forward_no_reply_time,
+ gint forward_ton, gint forward_npi, const gchar *forward_number,
+ gpointer user_data)
+{
+ struct treq_ss_forwarding req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_SS, "w"))
+ return TRUE;
+
+ memset(&req, 0x0, sizeof(struct treq_ss_forwarding));
+
+ req.class = ss_class;
+ req.mode = forward_mode;
+ req.time = forward_no_reply_time;
+ req.ton = forward_ton;
+ req.npi = forward_npi;
+ snprintf(req.number, MAX_SS_FORWARDING_NUMBER_LEN, "%s", forward_number);
+
+ dbg("Class: [%d] Forwarding - mode: [%d] time: [%d] number: [%s]",
+ req.class, req.mode, req.time, req.number);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, ss, invocation,
+ TREQ_SS_FORWARDING_REGISTER,
+ &req, sizeof(struct treq_ss_forwarding));
+
+ return TRUE;
+}
+
+static gboolean on_ss_deregister_forwarding(TelephonySs *ss,
+ GDBusMethodInvocation *invocation,
+ gint ss_class,
+ gint forward_mode,
+ gint forward_no_reply_time,
+ gint forward_ton, gint forward_npi, const gchar *forward_number,
+ gpointer user_data)
+{
+ struct treq_ss_forwarding req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_SS, "w"))
+ return TRUE;
+
+ memset(&req, 0x0, sizeof(struct treq_ss_forwarding));
+
+ req.class = ss_class;
+ req.mode = forward_mode;
+ req.time = forward_no_reply_time;
+ req.ton = forward_ton;
+ req.npi = forward_npi;
+ snprintf(req.number, MAX_SS_FORWARDING_NUMBER_LEN, "%s", forward_number);
+
+ dbg("Class: [%d] Forwarding - mode: [%d] time: [%d] number: [%s]",
+ req.class, req.mode, req.time, req.number);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, ss, invocation,
+ TREQ_SS_FORWARDING_DEREGISTER,
+ &req, sizeof(struct treq_ss_forwarding));
+
+ return TRUE;
+}
+
+static gboolean on_ss_activate_forwarding(TelephonySs *ss,
+ GDBusMethodInvocation *invocation,
+ gint ss_class,
+ gint forward_mode,
+ gint forward_no_reply_time,
+ gint forward_ton, gint forward_npi, const gchar *forward_number,
+ gpointer user_data)
+{
+ struct treq_ss_forwarding req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_SS, "w"))
+ return TRUE;
+
+ memset(&req, 0x0, sizeof(struct treq_ss_forwarding));
+
+ req.class = ss_class;
+ req.mode = forward_mode;
+ req.time = forward_no_reply_time;
+ req.ton = forward_ton;
+ req.npi = forward_npi;
+ snprintf(req.number, MAX_SS_FORWARDING_NUMBER_LEN, "%s", forward_number);
+
+ dbg("Class: [%d] Forwarding - mode: [%d] time: [%d] number: [%s]",
+ req.class, req.mode, req.time, req.number);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, ss, invocation,
+ TREQ_SS_FORWARDING_ACTIVATE,
+ &req, sizeof(struct treq_ss_forwarding));
+
+ return TRUE;
+}
+
+static gboolean on_ss_deactivate_forwarding(TelephonySs *ss,
+ GDBusMethodInvocation *invocation,
+ gint ss_class,
+ gint forward_mode,
+ gint forward_no_reply_time,
+ gint forward_ton, gint forward_npi, const gchar *forward_number,
+ gpointer user_data)
+{
+ struct treq_ss_forwarding req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_SS, "w"))
+ return TRUE;
+
+ memset(&req, 0x0, sizeof(struct treq_ss_forwarding));
+
+ req.class = ss_class;
+ req.mode = forward_mode;
+ req.time = forward_no_reply_time;
+ req.ton = forward_ton;
+ req.npi = forward_npi;
+ snprintf(req.number, MAX_SS_FORWARDING_NUMBER_LEN, "%s", forward_number);
+
+ dbg("Class: [%d] Forwarding - mode: [%d] time: [%d] number: [%s]",
+ req.class, req.mode, req.time, req.number);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, ss, invocation,
+ TREQ_SS_FORWARDING_DEACTIVATE,
+ &req, sizeof(struct treq_ss_forwarding));
+
+ return TRUE;
+}
+
+static gboolean on_ss_get_forwarding_status(TelephonySs *ss,
+ GDBusMethodInvocation *invocation,
+ gint ss_class,
+ gint forward_mode,
+ gpointer user_data)
+{
+ struct treq_ss_forwarding req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_SS, "r"))
+ return TRUE;
+
+ memset(&req, 0x0, sizeof(struct treq_ss_forwarding));
+
+ req.class = ss_class;
+ req.mode = forward_mode;
+
+ dbg("Class: [%d] Forwarding mode: [%d]", req.class, req.mode);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, ss, invocation,
+ TREQ_SS_FORWARDING_GET_STATUS,
+ &req, sizeof(struct treq_ss_forwarding));
+
+ return TRUE;
+}
+
+static gboolean on_ss_activate_waiting(TelephonySs *ss,
+ GDBusMethodInvocation *invocation,
+ gint ss_class, gpointer user_data)
+{
+ struct treq_ss_waiting req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_SS, "w"))
+ return TRUE;
+
+ memset(&req, 0x0, sizeof(struct treq_ss_waiting));
+
+ req.class = ss_class;
+
+ dbg("Class: [%d]", req.class);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, ss, invocation,
+ TREQ_SS_WAITING_ACTIVATE,
+ &req, sizeof(struct treq_ss_waiting));
+
+ return TRUE;
+}
+
+static gboolean on_ss_deactivate_waiting(TelephonySs *ss,
+ GDBusMethodInvocation *invocation,
+ gint ss_class, gpointer user_data)
+{
+ struct treq_ss_waiting req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_SS, "w"))
+ return TRUE;
+
+ memset(&req, 0x0, sizeof(struct treq_ss_waiting));
+
+ req.class = ss_class;
+
+ dbg("Class: [%d]", req.class);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, ss, invocation,
+ TREQ_SS_WAITING_DEACTIVATE,
+ &req, sizeof(struct treq_ss_waiting));
+
+ return TRUE;
+}
+
+static gboolean on_ss_get_waiting_status(TelephonySs *ss,
+ GDBusMethodInvocation *invocation,
+ gint ss_class, gpointer user_data)
+{
+ struct treq_ss_waiting req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_SS, "r"))
+ return TRUE;
+
+ memset(&req, 0x0, sizeof(struct treq_ss_waiting));
+
+ req.class = ss_class;
+
+ dbg("Class: [%d]", req.class);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, ss, invocation,
+ TREQ_SS_WAITING_GET_STATUS,
+ &req, sizeof(struct treq_ss_waiting));
+
+ return TRUE;
+}
+
+static gboolean on_ss_set_cli_status(TelephonySs *ss,
+ GDBusMethodInvocation *invocation,
+ gint cli_type, gint cli_status, gpointer user_data)
+{
+ struct treq_ss_set_cli req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_SS, "w"))
+ return TRUE;
+
+ memset(&req, 0x0, sizeof(struct treq_ss_set_cli));
+
+ req.type = cli_type;
+ req.status = cli_status;
+
+ dbg("CLI - type: [%d] status: [%d]", req.type, req.status);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, ss, invocation,
+ TREQ_SS_CLI_SET_STATUS,
+ &req, sizeof(struct treq_ss_set_cli));
+
+ return TRUE;
+}
+
+
+static gboolean on_ss_get_cli_status(TelephonySs *ss,
+ GDBusMethodInvocation *invocation,
+ gint cli_type, gpointer user_data)
+{
+ struct treq_ss_cli req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_SS, "r"))
+ return TRUE;
+
+ memset(&req, 0x0, sizeof(struct treq_ss_cli));
+
+ req.type = cli_type;
+
+ dbg("CLI type: [%d]", req.type);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, ss, invocation,
+ TREQ_SS_CLI_GET_STATUS,
+ &req, sizeof(struct treq_ss_cli));
+
+ return TRUE;
+}
+
+static gboolean on_ss_send_ussd(TelephonySs *ss,
+ GDBusMethodInvocation *invocation,
+ gint ussd_type, gint ussd_dcs,
+ gint ussd_len, const gchar *ussd_string,
+ gpointer user_data)
+{
+ struct treq_ss_ussd req;
+ struct custom_data *ctx = user_data;
+
+ if (!check_access_control(invocation, AC_SS, "x"))
+ return TRUE;
+
+ memset(&req, 0x0, sizeof(struct treq_ss_ussd));
+
+ req.type = ussd_type;
+ req.dcs = (unsigned char)ussd_dcs;
+ req.len = (unsigned short)ussd_len;
+
+ snprintf((char *)req.str, MAX_SS_USSD_LEN, "%s", ussd_string);
+
+ dbg("USSD - type: [%d] dcs: [%d] len: [%d] string: [%s]",
+ req.type, req.dcs, req.len, req.str);
+
+ /* Dispatch request */
+ dtapi_dispatch_request(ctx, ss, invocation,
+ TREQ_SS_SEND_USSD,
+ &req, sizeof(struct treq_ss_ussd));
+
+ return TRUE;
+}
+
+gboolean dbus_plugin_setup_ss_interface(TelephonyObjectSkeleton *object,
+ struct custom_data *ctx)
+{
+ TelephonySs *ss;
+
+ ss = telephony_ss_skeleton_new();
+ telephony_object_skeleton_set_ss(object, ss);
+ g_object_unref(ss);
+
+ dbg("ss = %p", ss);
+
+ /*
+ * Register signal handlers for SS interface
+ */
+ g_signal_connect(ss,
+ "handle-activate-barring",
+ G_CALLBACK(on_ss_activate_barring), ctx);
+
+ g_signal_connect(ss,
+ "handle-deactivate-barring",
+ G_CALLBACK(on_ss_deactivate_barring), ctx);
+
+ g_signal_connect(ss,
+ "handle-change-barring-password",
+ G_CALLBACK(on_ss_change_barring_password), ctx);
+
+ g_signal_connect(ss,
+ "handle-get-barring-status",
+ G_CALLBACK(on_ss_get_barring_status), ctx);
+
+ g_signal_connect(ss,
+ "handle-register-forwarding",
+ G_CALLBACK(on_ss_register_forwarding), ctx);
+
+ g_signal_connect(ss,
+ "handle-deregister-forwarding",
+ G_CALLBACK(on_ss_deregister_forwarding), ctx);
+
+ g_signal_connect(ss,
+ "handle-activate-forwarding",
+ G_CALLBACK(on_ss_activate_forwarding), ctx);
+
+ g_signal_connect(ss,
+ "handle-deactivate-forwarding",
+ G_CALLBACK(on_ss_deactivate_forwarding), ctx);
+
+ g_signal_connect(ss,
+ "handle-get-forwarding-status",
+ G_CALLBACK(on_ss_get_forwarding_status), ctx);
+
+ g_signal_connect(ss,
+ "handle-activate-waiting",
+ G_CALLBACK(on_ss_activate_waiting), ctx);
+
+ g_signal_connect(ss,
+ "handle-deactivate-waiting",
+ G_CALLBACK(on_ss_deactivate_waiting), ctx);
+
+ g_signal_connect(ss,
+ "handle-get-waiting-status",
+ G_CALLBACK(on_ss_get_waiting_status), ctx);
+
+ g_signal_connect(ss,
+ "handle-set-clistatus",
+ G_CALLBACK(on_ss_set_cli_status), ctx);
+
+ g_signal_connect(ss,
+ "handle-get-clistatus",
+ G_CALLBACK(on_ss_get_cli_status), ctx);
+
+ g_signal_connect(ss,
+ "handle-send-ussd",
+ G_CALLBACK(on_ss_send_ussd), ctx);
+
+ return TRUE;
+}
+
+gboolean dbus_plugin_ss_response(struct custom_data *ctx,
+ UserRequest *ur, struct dbus_request_info *dbus_info,
+ enum tcore_response_command command, unsigned int data_len, const void *data)
+{
+ GVariant *result = 0;
+ GVariantBuilder b;
+ int i = 0;
+
+ if (!data) {
+ err("response data : 0");
+ return FALSE;
+ }
+
+ switch (command) {
+ case TRESP_SS_BARRING_ACTIVATE: {
+ const struct tresp_ss_barring *resp = data;
+
+ dbg("receive TRESP_SS_BARRING_ACTIVATE (err[%d])", resp->err);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+ for (i = 0; i < resp->record_num; i++) {
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "ss_class",
+ g_variant_new_int32(resp->record[i].class));
+ g_variant_builder_add(&b, "{sv}", "ss_status",
+ g_variant_new_int32(resp->record[i].status));
+ g_variant_builder_add(&b, "{sv}", "barring_mode",
+ g_variant_new_int32(resp->record[i].mode));
+ g_variant_builder_close(&b);
+ }
+ result = g_variant_builder_end(&b);
+
+ telephony_ss_complete_activate_barring(dbus_info->interface_object,
+ dbus_info->invocation, result, resp->err);
+ }
+ break;
+
+ case TRESP_SS_BARRING_DEACTIVATE: {
+ const struct tresp_ss_barring *resp = data;
+
+ dbg("receive TRESP_SS_BARRING_DEACTIVATE (err[%d])", resp->err);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+ for (i = 0; i < resp->record_num; i++) {
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "ss_class",
+ g_variant_new_int32(resp->record[i].class));
+ g_variant_builder_add(&b, "{sv}", "ss_status",
+ g_variant_new_int32(resp->record[i].status));
+ g_variant_builder_add(&b, "{sv}", "barring_mode",
+ g_variant_new_int32(resp->record[i].mode));
+ g_variant_builder_close(&b);
+ }
+ result = g_variant_builder_end(&b);
+
+ telephony_ss_complete_deactivate_barring(dbus_info->interface_object,
+ dbus_info->invocation, result, resp->err);
+ }
+ break;
+
+ case TRESP_SS_BARRING_CHANGE_PASSWORD: {
+ const struct tresp_ss_general *resp = data;
+
+ dbg("receive TRESP_SS_BARRING_CHANGE_PASSWORD (err[%d])", resp->err);
+
+ telephony_ss_complete_change_barring_password(dbus_info->interface_object,
+ dbus_info->invocation, resp->err);
+ }
+ break;
+
+ case TRESP_SS_BARRING_GET_STATUS: {
+ const struct tresp_ss_barring *resp = data;
+
+ dbg("receive TRESP_SS_BARRING_GET_STATUS (err[%d])", resp->err);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+ for (i = 0; i < resp->record_num; i++) {
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "ss_class",
+ g_variant_new_int32(resp->record[i].class));
+ g_variant_builder_add(&b, "{sv}", "ss_status",
+ g_variant_new_int32(resp->record[i].status));
+ g_variant_builder_add(&b, "{sv}", "barring_mode",
+ g_variant_new_int32(resp->record[i].mode));
+ g_variant_builder_close(&b);
+ }
+ result = g_variant_builder_end(&b);
+
+ telephony_ss_complete_get_barring_status(dbus_info->interface_object,
+ dbus_info->invocation, result, resp->err);
+ }
+ break;
+
+ case TRESP_SS_FORWARDING_ACTIVATE: {
+ const struct tresp_ss_forwarding *resp = data;
+
+ dbg("receive TRESP_SS_FORWARDING_ACTIVATE (err[%d])", resp->err);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+ for (i = 0; i < resp->record_num; i++) {
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "ss_class",
+ g_variant_new_int32(resp->record[i].class));
+ g_variant_builder_add(&b, "{sv}", "ss_status",
+ g_variant_new_int32(resp->record[i].status));
+ g_variant_builder_add(&b, "{sv}", "forwarding_mode",
+ g_variant_new_int32(resp->record[i].mode));
+ g_variant_builder_add(&b, "{sv}", "number_present",
+ g_variant_new_int32(resp->record[i].number_present));
+ g_variant_builder_add(&b, "{sv}", "no_reply_time",
+ g_variant_new_int32(resp->record[i].time));
+ g_variant_builder_add(&b, "{sv}", "type_of_number",
+ g_variant_new_int32(resp->record[i].ton));
+ g_variant_builder_add(&b, "{sv}", "numbering_plan_identity",
+ g_variant_new_int32(resp->record[i].npi));
+ g_variant_builder_add(&b, "{sv}", "forwarding_number",
+ g_variant_new_string(resp->record[i].number));
+ g_variant_builder_close(&b);
+ }
+ result = g_variant_builder_end(&b);
+
+ telephony_ss_complete_activate_forwarding(dbus_info->interface_object,
+ dbus_info->invocation, result, resp->err);
+ }
+ break;
+
+ case TRESP_SS_FORWARDING_DEACTIVATE: {
+ const struct tresp_ss_forwarding *resp = data;
+
+ dbg("receive TRESP_SS_FORWARDING_DEACTIVATE (err[%d])", resp->err);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+ for (i = 0; i < resp->record_num; i++) {
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "ss_class",
+ g_variant_new_int32(resp->record[i].class));
+ g_variant_builder_add(&b, "{sv}", "ss_status",
+ g_variant_new_int32(resp->record[i].status));
+ g_variant_builder_add(&b, "{sv}", "forwarding_mode",
+ g_variant_new_int32(resp->record[i].mode));
+ g_variant_builder_add(&b, "{sv}", "number_present",
+ g_variant_new_int32(resp->record[i].number_present));
+ g_variant_builder_add(&b, "{sv}", "no_reply_time",
+ g_variant_new_int32(resp->record[i].time));
+ g_variant_builder_add(&b, "{sv}", "type_of_number",
+ g_variant_new_int32(resp->record[i].ton));
+ g_variant_builder_add(&b, "{sv}", "numbering_plan_identity",
+ g_variant_new_int32(resp->record[i].npi));
+ g_variant_builder_add(&b, "{sv}", "forwarding_number",
+ g_variant_new_string(resp->record[i].number));
+ g_variant_builder_close(&b);
+ }
+ result = g_variant_builder_end(&b);
+
+ telephony_ss_complete_deactivate_forwarding(dbus_info->interface_object,
+ dbus_info->invocation, result, resp->err);
+ }
+ break;
+
+ case TRESP_SS_FORWARDING_REGISTER: {
+ const struct tresp_ss_forwarding *resp = data;
+
+ dbg("receive TRESP_SS_FORWARDING_REGISTER (err[%d])", resp->err);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+ for (i = 0; i < resp->record_num; i++) {
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "ss_class",
+ g_variant_new_int32(resp->record[i].class));
+ g_variant_builder_add(&b, "{sv}", "ss_status",
+ g_variant_new_int32(resp->record[i].status));
+ g_variant_builder_add(&b, "{sv}", "forwarding_mode",
+ g_variant_new_int32(resp->record[i].mode));
+ g_variant_builder_add(&b, "{sv}", "number_present",
+ g_variant_new_int32(resp->record[i].number_present));
+ g_variant_builder_add(&b, "{sv}", "no_reply_time",
+ g_variant_new_int32(resp->record[i].time));
+ g_variant_builder_add(&b, "{sv}", "type_of_number",
+ g_variant_new_int32(resp->record[i].ton));
+ g_variant_builder_add(&b, "{sv}", "numbering_plan_identity",
+ g_variant_new_int32(resp->record[i].npi));
+ g_variant_builder_add(&b, "{sv}", "forwarding_number",
+ g_variant_new_string(resp->record[i].number));
+ g_variant_builder_close(&b);
+ }
+ result = g_variant_builder_end(&b);
+
+ telephony_ss_complete_register_forwarding(dbus_info->interface_object,
+ dbus_info->invocation, result, resp->err);
+ }
+ break;
+
+ case TRESP_SS_FORWARDING_DEREGISTER: {
+ const struct tresp_ss_forwarding *resp = data;
+
+ dbg("receive TRESP_SS_FORWARDING_DEREGISTER (err[%d])", resp->err);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+ for (i = 0; i < resp->record_num; i++) {
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "ss_class",
+ g_variant_new_int32(resp->record[i].class));
+ g_variant_builder_add(&b, "{sv}", "ss_status",
+ g_variant_new_int32(resp->record[i].status));
+ g_variant_builder_add(&b, "{sv}", "forwarding_mode",
+ g_variant_new_int32(resp->record[i].mode));
+ g_variant_builder_add(&b, "{sv}", "number_present",
+ g_variant_new_int32(resp->record[i].number_present));
+ g_variant_builder_add(&b, "{sv}", "no_reply_time",
+ g_variant_new_int32(resp->record[i].time));
+ g_variant_builder_add(&b, "{sv}", "type_of_number",
+ g_variant_new_int32(resp->record[i].ton));
+ g_variant_builder_add(&b, "{sv}", "numbering_plan_identity",
+ g_variant_new_int32(resp->record[i].npi));
+ g_variant_builder_add(&b, "{sv}", "forwarding_number",
+ g_variant_new_string(resp->record[i].number));
+ g_variant_builder_close(&b);
+ }
+ result = g_variant_builder_end(&b);
+
+ telephony_ss_complete_deregister_forwarding(dbus_info->interface_object,
+ dbus_info->invocation, result, resp->err);
+ }
+ break;
+
+ case TRESP_SS_FORWARDING_GET_STATUS: {
+ const struct tresp_ss_forwarding *resp = data;
+
+ dbg("receive TRESP_SS_FORWARDING_GET_STATUS (err[%d])", resp->err);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+ for (i = 0; i < resp->record_num; i++) {
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "ss_class",
+ g_variant_new_int32(resp->record[i].class));
+ g_variant_builder_add(&b, "{sv}", "ss_status",
+ g_variant_new_int32(resp->record[i].status));
+ g_variant_builder_add(&b, "{sv}", "forwarding_mode",
+ g_variant_new_int32(resp->record[i].mode));
+ g_variant_builder_add(&b, "{sv}", "number_present",
+ g_variant_new_int32(resp->record[i].number_present));
+ g_variant_builder_add(&b, "{sv}", "no_reply_time",
+ g_variant_new_int32(resp->record[i].time));
+ g_variant_builder_add(&b, "{sv}", "type_of_number",
+ g_variant_new_int32(resp->record[i].ton));
+ g_variant_builder_add(&b, "{sv}", "numbering_plan_identity",
+ g_variant_new_int32(resp->record[i].npi));
+ g_variant_builder_add(&b, "{sv}", "forwarding_number",
+ g_variant_new_string(resp->record[i].number));
+ g_variant_builder_close(&b);
+ }
+ result = g_variant_builder_end(&b);
+
+ telephony_ss_complete_get_forwarding_status(dbus_info->interface_object,
+ dbus_info->invocation, result, resp->err);
+ }
+ break;
+
+ case TRESP_SS_WAITING_ACTIVATE: {
+ const struct tresp_ss_waiting *resp = data;
+
+ dbg("receive TRESP_SS_WAITING_ACTIVATE (err[%d])", resp->err);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+ for (i = 0; i < resp->record_num; i++) {
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "ss_class",
+ g_variant_new_int32(resp->record[i].class));
+ g_variant_builder_add(&b, "{sv}", "ss_status",
+ g_variant_new_int32(resp->record[i].status));
+ g_variant_builder_close(&b);
+ }
+ result = g_variant_builder_end(&b);
+
+ telephony_ss_complete_activate_waiting(dbus_info->interface_object,
+ dbus_info->invocation, result, resp->err);
+ }
+ break;
+
+ case TRESP_SS_WAITING_DEACTIVATE: {
+ const struct tresp_ss_waiting *resp = data;
+
+ dbg("receive TRESP_SS_WAITING_DEACTIVATE (err[%d])", resp->err);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+ for (i = 0; i < resp->record_num; i++) {
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "ss_class",
+ g_variant_new_int32(resp->record[i].class));
+ g_variant_builder_add(&b, "{sv}", "ss_status",
+ g_variant_new_int32(resp->record[i].status));
+ g_variant_builder_close(&b);
+ }
+ result = g_variant_builder_end(&b);
+
+ telephony_ss_complete_deactivate_waiting(dbus_info->interface_object,
+ dbus_info->invocation, result, resp->err);
+ }
+ break;
+
+ case TRESP_SS_WAITING_GET_STATUS: {
+ const struct tresp_ss_waiting *resp = data;
+
+ dbg("receive TRESP_SS_WAITING_GET_STATUS (err[%d])", resp->err);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+ for (i = 0; i < resp->record_num; i++) {
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "ss_class",
+ g_variant_new_int32(resp->record[i].class));
+ g_variant_builder_add(&b, "{sv}", "ss_status",
+ g_variant_new_int32(resp->record[i].status));
+ g_variant_builder_close(&b);
+ }
+ result = g_variant_builder_end(&b);
+
+ telephony_ss_complete_get_waiting_status(dbus_info->interface_object,
+ dbus_info->invocation, result, resp->err);
+ }
+ break;
+
+ case TRESP_SS_CLI_SET_STATUS: {
+ const struct tresp_ss_set_cli *resp = data;
+
+ dbg("receive TRESP_SS_CLI_SET_STATUS (err[%d])", resp->err);
+
+ telephony_ss_complete_set_clistatus(dbus_info->interface_object,
+ dbus_info->invocation, resp->err);
+ }
+ break;
+
+ case TRESP_SS_CLI_GET_STATUS: {
+ const struct tresp_ss_cli *resp = data;
+
+ dbg("receive TRESP_SS_CLI_GET_STATUS (err[%d])", resp->err);
+
+ telephony_ss_complete_get_clistatus(dbus_info->interface_object,
+ dbus_info->invocation, resp->err, resp->type, resp->status);
+ }
+ break;
+
+ case TRESP_SS_SEND_USSD: {
+ const struct tresp_ss_ussd *resp = data;
+
+ dbg("receive TRESP_SS_SEND_USSD (err[%d])", resp->err);
+ dbg("USSD - type: [0x%x] status: [0x%x] dcs: [0x%x] len: [%d] string: [%s])",
+ resp->type, resp->status, resp->dcs, resp->len, resp->str);
+
+ telephony_ss_complete_send_ussd(dbus_info->interface_object,
+ dbus_info->invocation, resp->err,
+ resp->type, resp->status, resp->dcs,
+ resp->len, (char *)resp->str);
+ }
+ break;
+
+ default:
+ err("Unhandled/Unknown Response: [0x%x]", command);
+ break;
+ }
+
+ return TRUE;
+}
+
+gboolean dbus_plugin_ss_notification(struct custom_data *ctx,
+ CoreObject *source, TelephonyObjectSkeleton *object,
+ enum tcore_notification_command command, unsigned int data_len, const void *data)
+{
+ TelephonySs *ss = 0;
+ GVariant *result = 0;
+ GVariantBuilder b;
+ int i = 0;
+ char *cp_name = NULL;
+
+ if (!object) {
+ err("object is NULL");
+ return FALSE;
+ }
+
+ if (!data) {
+ err("data is NULL");
+ return FALSE;
+ }
+
+ cp_name = (char *)tcore_server_get_cp_name_by_plugin(tcore_object_ref_plugin(source));
+ ss = telephony_object_peek_ss(TELEPHONY_OBJECT(object));
+ if (ss == NULL) {
+ err("ss object is NULL!!!");
+ return FALSE;
+ }
+
+ switch (command) {
+ case TNOTI_SS_USSD: {
+ const struct tnoti_ss_ussd *ussd = data;
+ enum dbus_tapi_sim_slot_id slot_id;
+
+ dbg("[%s] SS_USSD - status: [0x%x] dcs: [0x%x] len: [%d] string: [%s])",
+ cp_name, ussd->status, ussd->dcs, ussd->len, ussd->str);
+
+ telephony_ss_emit_notify_ussd(ss,
+ ussd->status,
+ ussd->dcs,
+ ussd->len,
+ (char *)ussd->str);
+
+ /*
+ * Launch CISS application for specific slot ID.
+ */
+ slot_id = get_sim_slot_id_by_cp_name(cp_name);
+ __launch_ciss(ussd, slot_id);
+ }
+ break;
+
+ case TNOTI_SS_FORWARDING_STATUS: {
+ const struct tnoti_ss_forwarding_status *fwrd = data;
+
+ dbg("[%s] SS_FORWARDING_STATUS", cp_name);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+ for (i = 0; i < fwrd->record_num; i++) {
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "ss_class",
+ g_variant_new_int32(fwrd->record[i].class));
+ g_variant_builder_add(&b, "{sv}", "ss_status",
+ g_variant_new_int32(fwrd->record[i].status));
+ g_variant_builder_add(&b, "{sv}", "forwarding_mode",
+ g_variant_new_int32(fwrd->record[i].mode));
+ g_variant_builder_add(&b, "{sv}", "number_present",
+ g_variant_new_int32(fwrd->record[i].number_present));
+ g_variant_builder_add(&b, "{sv}", "no_reply_time",
+ g_variant_new_int32(fwrd->record[i].time));
+ g_variant_builder_add(&b, "{sv}", "type_of_number",
+ g_variant_new_int32(fwrd->record[i].ton));
+ g_variant_builder_add(&b, "{sv}", "numbering_plan_identity",
+ g_variant_new_int32(fwrd->record[i].npi));
+ g_variant_builder_add(&b, "{sv}", "forwarding_number",
+ g_variant_new_string(fwrd->record[i].number));
+ g_variant_builder_close(&b);
+ }
+ result = g_variant_builder_end(&b);
+
+ telephony_ss_emit_notify_forwarding(ss, result);
+ }
+ break;
+
+ case TNOTI_SS_BARRING_STATUS: {
+ const struct tnoti_ss_barring_status *barr = data;
+
+ dbg("[%s] SS_BARRING_STATUS", cp_name);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+ for (i = 0; i < barr->record_num; i++) {
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "ss_class",
+ g_variant_new_int32(barr->record[i].class));
+ g_variant_builder_add(&b, "{sv}", "ss_status",
+ g_variant_new_int32(barr->record[i].status));
+ g_variant_builder_add(&b, "{sv}", "barring_mode",
+ g_variant_new_int32(barr->record[i].mode));
+ g_variant_builder_close(&b);
+ }
+ result = g_variant_builder_end(&b);
+
+ telephony_ss_emit_notify_barring(ss, result);
+ }
+ break;
+
+ case TNOTI_SS_WAITING_STATUS: {
+ const struct tnoti_ss_waiting_status *wait = data;
+
+ dbg("[%s] SS_WAITING_STATUS", cp_name);
+
+ g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
+ for (i = 0; i < wait->record_num; i++) {
+ g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add(&b, "{sv}", "ss_class",
+ g_variant_new_int32(wait->record[i].class));
+ g_variant_builder_add(&b, "{sv}", "ss_status",
+ g_variant_new_int32(wait->record[i].status));
+ g_variant_builder_close(&b);
+ }
+ result = g_variant_builder_end(&b);
+
+ telephony_ss_emit_notify_waiting(ss, result);
+ }
+ break;
+
+ case TNOTI_SS_RELEASE_COMPLETE: {
+ int i = 0;
+ GVariantBuilder builder;
+ GVariant *msg_data = 0, *packet = NULL;
+ const struct tnoti_ss_release_complete *msg = data;
+
+ dbg("[%s] SS_RELEASE_COMPLETE", cp_name);
+
+ if (msg) {
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("ay"));
+ for (i = 0; i < msg->data_len; i++)
+ g_variant_builder_add(&builder, "y", msg->data[i]);
+ msg_data = g_variant_builder_end(&builder);
+
+ packet = g_variant_new("v", msg_data);
+ dbg("type_format(%s)", g_variant_get_type_string(packet));
+
+ telephony_ss_emit_release_complete(ss,
+ msg->data_len, packet);
+ } else {
+ dbg("No data is passed in USSD release notification");
+
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("ay"));
+ g_variant_builder_add(&builder, "y", '\0');
+ msg_data = g_variant_builder_end(&builder);
+
+ packet = g_variant_new("v", msg_data);
+ dbg("type_format(%s)", g_variant_get_type_string(packet));
+
+ telephony_ss_emit_release_complete(ss,
+ 1, packet);
+ }
+ }
+ break;
+
+ case TNOTI_SS_INFO: {
+ const struct tnoti_ss_information *ss_info = data;
+ enum dbus_tapi_sim_slot_id slot_id;
+
+ dbg("[%s] SS_INFO", cp_name);
+
+ telephony_ss_emit_notify_ss_info(ss,
+ ss_info->err,
+ ss_info->ss_type);
+
+ /*
+ * Launch CISS information.
+ */
+ slot_id = get_sim_slot_id_by_cp_name(cp_name);
+ __launch_ciss_information(ss_info, slot_id);
+#if 0
+ /* Launch CISS application */
+ __launch_ciss(ss_info);
+#endif
+ }
+ break;
+
+ default:
+ err("Unhandled/Unknown Notification: [0x%x]", command);
+ break;
+ }
+
+ return TRUE;
+}
+
+++ /dev/null
-#include <stdio.h>
-#include <string.h>
-#include <pthread.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <time.h>
-#include <glib.h>
-#include <gio/gio.h>
-
-#include <tcore.h>
-#include <server.h>
-#include <plugin.h>
-#include <hal.h>
-#include <communicator.h>
-#include <storage.h>
-#include <queue.h>
-#include <user_request.h>
-#include <co_gps.h>
-#include <co_sim.h>
-#include <co_ps.h>
-
-#include "generated-code.h"
-#include "common.h"
-
-static gboolean
-on_gps_set_frequency_aiding (TelephonyGps *gps,
- GDBusMethodInvocation *invocation,
- guchar data,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (!check_access_control (invocation, AC_GPS, "w"))
- return TRUE;
-
- ur = MAKE_UR(ctx, gps, invocation);
- dbg("data=%d",data);
-
- tcore_user_request_set_data(ur, sizeof(data), (const char*)&data);
- tcore_user_request_set_command(ur, TREQ_GPS_SET_FREQUENCY_AIDING);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_gps_confirm_measure_pos (TelephonyGps *gps,
- GDBusMethodInvocation *invocation,
- const gchar *data,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- gboolean result = TRUE;
- guchar *decoded_data = NULL;
- gsize length;
-
- if (!check_access_control (invocation, AC_GPS, "w"))
- return TRUE;
-
- ur = MAKE_UR(ctx, gps, invocation);
-
- decoded_data = g_base64_decode(data, &length);
- dbg("decoded length=%d", length);
- tcore_user_request_set_data(ur, length, decoded_data);
- tcore_user_request_set_command(ur, TREQ_GPS_CONFIRM_MEASURE_POS);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- g_free(decoded_data);
- return TRUE;
- }
-
- telephony_gps_complete_confirm_measure_pos(gps, invocation, result);
- g_free(decoded_data);
-
- return TRUE;
-}
-
-static gboolean
-on_enable_smart_assistant(TelephonyGps *gps,
- GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (!check_access_control (invocation, AC_GPS, "w"))
- return TRUE;
-
- ur = MAKE_UR(ctx, gps, invocation);
-
- tcore_user_request_set_command(ur, TREQ_ENABLE_SMART_ASSISTANT);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_disable_smart_assistant(TelephonyGps *gps,
- GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (!check_access_control (invocation, AC_GPS, "w"))
- return TRUE;
-
- ur = MAKE_UR(ctx, gps, invocation);
-
- tcore_user_request_set_command(ur, TREQ_DISABLE_SMART_ASSISTANT);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_sync_smart_assistant_area_list(TelephonyGps *gps,
- GDBusMethodInvocation *invocation,
- gint count,
- GVariant *gv,
- gpointer user_data)
-{
- struct tel_smart_assistant_area_list req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- GVariantIter *iter = NULL;
- GVariant *b = NULL;
- int i = 0;
- gint item1, item2;
- dbg("enter count=%d", count);
-
- if (!check_access_control (invocation, AC_GPS, "w"))
- return TRUE;
-
- ur = MAKE_UR(ctx, gps, invocation);
- memset(&req,0,sizeof(struct tel_smart_assistant_area_list));
-
- dbg("count=%d", count);
- if (count > SMART_ASSISTANT_AREA_LIST_MAX)
- count = SMART_ASSISTANT_AREA_LIST_MAX;
-
- req.count = count;
-
- g_variant_get (gv, "v", &b);
- g_variant_unref (gv);
-
- g_variant_get (b, "a(ii)", &iter);
- while(g_variant_iter_loop(iter,"(ii)",&item1, &item2)){
- req.area[i].index = item1;
- req.area[i].mode_state = item2;
- i++;
- if (i == count)
- break;
- }
- g_variant_iter_free(iter);
-
- tcore_user_request_set_data(ur, sizeof(struct tel_smart_assistant_area_list), &req);
- tcore_user_request_set_command(ur, TREQ_SYNC_SMART_ASSISTANT_AREA_LIST);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_del_smart_assistant_area_list(TelephonyGps *gps,
- GDBusMethodInvocation *invocation,
- gint count,
- GVariant *gv,
- gpointer user_data)
-{
- struct tel_smart_assistant_area_list req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- GVariantIter *iter = NULL;
- GVariant *b = NULL;
- int i = 0;
- gint item1, item2;
-
- if (!check_access_control (invocation, AC_GPS, "w"))
- return TRUE;
-
- ur = MAKE_UR(ctx, gps, invocation);
- memset(&req,0,sizeof(struct tel_smart_assistant_area_list));
-
- dbg("count=%d", count);
- if (count > SMART_ASSISTANT_AREA_LIST_MAX)
- count = SMART_ASSISTANT_AREA_LIST_MAX;
-
- req.count = count;
-
- g_variant_get (gv, "v", &b);
- g_variant_unref (gv);
-
- g_variant_get (b, "a(ii)", &iter);
- while(g_variant_iter_loop(iter,"(ii)",&item1, &item2)){
- req.area[i].index = item1;
- req.area[i].mode_state = item2;
- i++;
- if (i == count)
- break;
- }
- g_variant_iter_free(iter);
-
- tcore_user_request_set_data(ur, sizeof(struct tel_smart_assistant_area_list), &req);
- tcore_user_request_set_command(ur, TREQ_DEL_SMART_ASSISTANT_AREA_LIST);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_add_smart_assistant_area(TelephonyGps *gps,
- GDBusMethodInvocation *invocation,
- gint fn_index,
- gint mode_state,
- gpointer user_data)
-{
- struct tel_smart_assistant_area req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (!check_access_control (invocation, AC_GPS, "w"))
- return TRUE;
-
- ur = MAKE_UR(ctx, gps, invocation);
- req.index = fn_index;
- req.mode_state = mode_state;
- dbg("index=%d, mode_state=%d",req.index, req.mode_state);
-
- tcore_user_request_set_data(ur, sizeof(struct tel_smart_assistant_area), &req);
- tcore_user_request_set_command(ur, TREQ_ADD_SMART_ASSISTANT_AREA);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-static gboolean
-on_modify_smart_assistant_area(TelephonyGps *gps,
- GDBusMethodInvocation *invocation,
- gint fn_index,
- gint mode_state,
- gpointer user_data)
-{
- struct tel_smart_assistant_area req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (!check_access_control (invocation, AC_GPS, "w"))
- return TRUE;
-
- ur = MAKE_UR(ctx, gps, invocation);
- req.index = fn_index;
- req.mode_state = mode_state;
- dbg("index=%d, mode_state=%d",req.index, req.mode_state);
-
- tcore_user_request_set_data(ur, sizeof(struct tel_smart_assistant_area), &req);
- tcore_user_request_set_command(ur, TREQ_MODIFY_SMART_ASSISTANT_AREA);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_set_smart_assistant_info(TelephonyGps *gps,
- GDBusMethodInvocation *invocation,
- gint fn_index,
- gint lpp_state,
- gpointer user_data)
-{
- struct treq_set_smart_assistant_info req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (!check_access_control (invocation, AC_GPS, "w"))
- return TRUE;
-
- ur = MAKE_UR(ctx, gps, invocation);
- req.index = fn_index;
- req.lpp_state = lpp_state;
- dbg("index=%d, lpp_state=%d",req.index, req.lpp_state);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_set_smart_assistant_info), &req);
- tcore_user_request_set_command(ur, TREQ_SET_SMART_ASSISTANT_INFO);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-gboolean dbus_plugin_setup_gps_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx)
-{
- TelephonyGps *gps;
-
- gps = telephony_gps_skeleton_new();
- telephony_object_skeleton_set_gps(object, gps);
-
- g_object_unref(gps);
-
- dbg("gps = %p", gps);
-
- g_signal_connect (gps,
- "handle-set-frequency-aiding",
- G_CALLBACK (on_gps_set_frequency_aiding),
- ctx);
-
- g_signal_connect (gps,
- "handle-confirm-measure-pos",
- G_CALLBACK (on_gps_confirm_measure_pos),
- ctx);
-
- g_signal_connect (gps,
- "handle-enable-smart-assistant",
- G_CALLBACK (on_enable_smart_assistant),
- ctx);
-
- g_signal_connect (gps,
- "handle-disable-smart-assistant",
- G_CALLBACK (on_disable_smart_assistant),
- ctx);
-
- g_signal_connect (gps,
- "handle-sync-smart-assistant-area-list",
- G_CALLBACK (on_sync_smart_assistant_area_list),
- ctx);
-
- g_signal_connect (gps,
- "handle-del-smart-assistant-area-list",
- G_CALLBACK (on_del_smart_assistant_area_list),
- ctx);
-
- g_signal_connect (gps,
- "handle-add-smart-assistant-area",
- G_CALLBACK (on_add_smart_assistant_area),
- ctx);
-
- g_signal_connect (gps,
- "handle-modify-smart-assistant-area",
- G_CALLBACK (on_modify_smart_assistant_area),
- ctx);
-
- g_signal_connect (gps,
- "handle-set-smart-assistant-info",
- G_CALLBACK (on_set_smart_assistant_info),
- ctx);
-
- return TRUE;
-}
-
-gboolean dbus_plugin_gps_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data)
-{
- const struct tresp_gps_set_frequency_aiding *resp_gps_frequency_aiding = data;
- const struct tresp_smart_assistant_result *resp_smart_assistant_result = data;
-
- GSList *co_list;
- CoreObject *co_gps;
- char *modem_name = NULL;
- TcorePlugin *p = NULL;
-
- modem_name = tcore_user_request_get_modem_name(ur);
- if (!modem_name)
- return FALSE;
-
- p = tcore_server_find_plugin(ctx->server, modem_name);
- free(modem_name);
- if (!p)
- return FALSE;
-
- co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_GPS);
- if (!co_list) {
- return FALSE;
- }
-
- co_gps = (CoreObject *)co_list->data;
- g_slist_free(co_list);
-
- if (!co_gps) {
- return FALSE;
- }
-
- switch (command) {
- case TRESP_GPS_SET_FREQUENCY_AIDING:
- dbg("TRESP_GPS_SET_FREQUENCY_AIDING result=%d", resp_gps_frequency_aiding->result);
- telephony_gps_complete_set_frequency_aiding(dbus_info->interface_object, dbus_info->invocation, resp_gps_frequency_aiding->result);
- break;
-
- case TRESP_ENABLE_SMART_ASSISTANT:
- dbg("TRESP_ENABLE_SMART_ASSISTANT result=%d", resp_smart_assistant_result->result);
- telephony_gps_complete_enable_smart_assistant(dbus_info->interface_object, dbus_info->invocation, resp_smart_assistant_result->result);
- break;
-
- case TRESP_DISABLE_SMART_ASSISTANT:
- dbg("TRESP_ENABLE_SMART_ASSISTANT result=%d", resp_smart_assistant_result->result);
- telephony_gps_complete_disable_smart_assistant(dbus_info->interface_object, dbus_info->invocation, resp_smart_assistant_result->result);
- break;
-
- case TRESP_SYNC_SMART_ASSISTANT_AREA_LIST:
- dbg("TRESP_SYNC_SMART_ASSISTANT_AREA_LIST result=%d", resp_smart_assistant_result->result);
- telephony_gps_complete_sync_smart_assistant_area_list(dbus_info->interface_object, dbus_info->invocation, resp_smart_assistant_result->result);
- break;
-
- case TRESP_DEL_SMART_ASSISTANT_AREA_LIST:
- dbg("TRESP_DEL_SMART_ASSISTANT_AREA_LIST result=%d", resp_smart_assistant_result->result);
- telephony_gps_complete_del_smart_assistant_area_list(dbus_info->interface_object, dbus_info->invocation, resp_smart_assistant_result->result);
- break;
-
- case TRESP_ADD_SMART_ASSISTANT_AREA:
- dbg("TRESP_ADD_SMART_ASSISTANT_AREA result=%d", resp_smart_assistant_result->result);
- telephony_gps_complete_add_smart_assistant_area(dbus_info->interface_object, dbus_info->invocation, resp_smart_assistant_result->result);
- break;
-
- case TRESP_MODIFY_SMART_ASSISTANT_AREA:
- dbg("TRESP_MODIFY_SMART_ASSISTANT_AREA result=%d", resp_smart_assistant_result->result);
- telephony_gps_complete_modify_smart_assistant_area(dbus_info->interface_object, dbus_info->invocation, resp_smart_assistant_result->result);
- break;
-
- case TRESP_SET_SMART_ASSISTANT_INFO:
- dbg("TRESP_SET_SMART_ASSISTANT_INFO result=%d", resp_smart_assistant_result->result);
- telephony_gps_complete_set_smart_assistant_info(dbus_info->interface_object, dbus_info->invocation, resp_smart_assistant_result->result);
- break;
-
- default:
- dbg("not handled cmd[0x%x]", command);
- break;
- }
-
- return TRUE;
-}
-
-gboolean dbus_plugin_gps_notification(struct custom_data *ctx, CoreObject *source, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data)
-{
- TelephonyGps *gps;
-
- if (!object) {
- dbg("object is NULL");
- return FALSE;
- }
- dbg("Notification!!! Command: [0x%x] CP Name: [%s]",
- command, tcore_server_get_cp_name_by_plugin(tcore_object_ref_plugin(source)));
-
- gps = telephony_object_peek_gps(TELEPHONY_OBJECT(object));
- switch (command) {
- case TNOTI_GPS_ASSIST_DATA:
- {
- gchar *encoded_data = NULL;
- dbg("gps(%p) TNOTI_GPS_ASSIST_DATA. data=%p, data_len=%d", gps, data, data_len);
- encoded_data = g_base64_encode((const guchar*)data, data_len);
- telephony_gps_emit_assist_data(gps, encoded_data);
- g_free(encoded_data);
- }
- break;
-
- case TNOTI_GPS_MEASURE_POSITION:
- {
- gchar *encoded_data = NULL;
- dbg("gps(%p) TNOTI_GPS_MEASURE_POSITION. data=%p, data_len=%d", gps, data, data_len);
- encoded_data = g_base64_encode((const guchar*)data, data_len);
- telephony_gps_emit_measure_position(gps, encoded_data);
- g_free(encoded_data);
- }
- break;
-
- case TNOTI_GPS_RESET_ASSIST_DATA:
- dbg("gps(%p) TNOTI_GPS_RESET_ASSIST_DATA", gps);
- telephony_gps_emit_reset_assist_data(gps);
- break;
-
- case TNOTI_GPS_FREQUENCY_AIDING_DATA:
- {
- gchar *encoded_data = NULL;
- dbg("gps(%p) TNOTI_GPS_FREQUENCY_AIDING_DATA. data=%p, data_len=%d", gps, data, data_len);
- encoded_data = g_base64_encode((const guchar*)data, data_len);
- telephony_gps_emit_frequency_aiding(gps, encoded_data);
- g_free(encoded_data);
- }
- break;
-
- case TNOTI_SMART_ASSISTANT_AREA_STATUS:
- {
- const struct tnoti_smart_assistant_area_status *noti = data;
- dbg("gps(%p) TNOTI_SMART_ASSISTANT_AREA_STATUS", gps);
- telephony_gps_emit_area_status(gps, noti->area_status, noti->index);
- }
- break;
-
- case TNOTI_SMART_ASSISTANT_SYNC_STATUS:
- {
- const struct tnoti_smart_assistant_sync_status *noti = data;
- dbg("gps(%p) TNOTI_SMART_ASSISTANT_SYNC_STATUS", gps);
- telephony_gps_emit_sync_status(gps, noti->init_status, noti->init_fail_cause);
- }
- break;
-
- default:
- dbg("not handled cmd[0x%x]", command);
- break;
- }
-
- return TRUE;
-}
-
+++ /dev/null
-/*
- * tel-plugin-dbus-tapi
- *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <pthread.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <time.h>
-#include <glib.h>
-#include <gio/gio.h>
-
-#include <tcore.h>
-#include <server.h>
-#include <plugin.h>
-#include <hal.h>
-#include <communicator.h>
-#include <storage.h>
-#include <queue.h>
-#include <user_request.h>
-#include <co_modem.h>
-
-#include "generated-code.h"
-#include "common.h"
-
-
-static gboolean
-on_modem_set_power (TelephonyModem *modem, GDBusMethodInvocation *invocation,
- gint mode, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- enum tcore_request_command command;
- TReturn ret = TCORE_RETURN_SUCCESS;
-
- if (!check_access_control (invocation, AC_MODEM, "x"))
- return TRUE;
-
- ur = MAKE_UR(ctx, modem, invocation);
-
- switch (mode) {
- case MODEM_STATE_ONLINE:
- command = TREQ_MODEM_POWER_ON;
- break;
- case MODEM_STATE_OFFLINE:
- command = TREQ_MODEM_POWER_OFF;
- break;
- case MODEM_STATE_RESET:
- command = TREQ_MODEM_POWER_RESET;
- break;
- case MODEM_STATE_LOW:
- command = TREQ_MODEM_POWER_LOW;
- break;
- default:
- ret = TCORE_RETURN_EINVAL;
- goto ERR;
- }
-
- tcore_user_request_set_command(ur, command);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS)
- goto ERR;
-
- return TRUE;
-
-ERR:
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
-
- return TRUE;
-}
-
-static gboolean
-on_modem_set_flight_mode (TelephonyModem *modem, GDBusMethodInvocation *invocation,
- gboolean enable, gpointer user_data)
-{
- struct treq_modem_set_flightmode data;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (!check_access_control (invocation, AC_MODEM, "w"))
- return TRUE;
-
- data.enable = enable;
-
- ur = MAKE_UR(ctx, modem, invocation);
- tcore_user_request_set_data (ur, sizeof(struct treq_modem_set_flightmode), &data);
- tcore_user_request_set_command (ur, TREQ_MODEM_SET_FLIGHTMODE);
-
- ret = tcore_communicator_dispatch_request (ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref (ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_modem_get_flight_mode (TelephonyModem *modem, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (!check_access_control (invocation, AC_MODEM, "r"))
- return TRUE;
-
- ur = MAKE_UR(ctx, modem, invocation);
- tcore_user_request_set_data(ur, 0, NULL);
- tcore_user_request_set_command(ur, TREQ_MODEM_GET_FLIGHTMODE);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_modem_get_version (TelephonyModem *modem, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (!check_access_control (invocation, AC_MODEM, "r"))
- return TRUE;
-
- ur = MAKE_UR(ctx, modem, invocation);
- tcore_user_request_set_command(ur, TREQ_MODEM_GET_VERSION);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_modem_get_serial_number (TelephonyModem *modem, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (!check_access_control (invocation, AC_MODEM, "r"))
- return TRUE;
-
- ur = MAKE_UR(ctx, modem, invocation);
- tcore_user_request_set_command(ur, TREQ_MODEM_GET_SN);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_modem_get_imei (TelephonyModem *modem, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (!check_access_control (invocation, AC_MODEM, "r"))
- return TRUE;
-
- ur = MAKE_UR(ctx, modem, invocation);
- tcore_user_request_set_command(ur, TREQ_MODEM_GET_IMEI);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_modem_set_dun_pin_ctrl (TelephonyModem *modem, GDBusMethodInvocation *invocation,
- gint arg_signal, gboolean arg_status, gpointer user_data)
-{
- struct treq_modem_set_dun_pin_control data;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (!check_access_control (invocation, AC_MODEM, "x"))
- return TRUE;
-
- data.signal = arg_signal;
- data.status = arg_status;
-
- ur = MAKE_UR(ctx, modem, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_modem_set_dun_pin_control), &data);
- tcore_user_request_set_command(ur, TREQ_MODEM_SET_DUN_PIN_CONTROL);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-gboolean dbus_plugin_setup_modem_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx)
-{
- TelephonyModem *modem;
-
- modem = telephony_modem_skeleton_new();
- telephony_object_skeleton_set_modem(object, modem);
- g_object_unref(modem);
-
- dbg("modem: [%p]", modem);
-
- g_signal_connect (modem,
- "handle-set-power",
- G_CALLBACK (on_modem_set_power),
- ctx);
-
- g_signal_connect (modem,
- "handle-set-flight-mode",
- G_CALLBACK (on_modem_set_flight_mode),
- ctx);
-
- g_signal_connect (modem,
- "handle-get-flight-mode",
- G_CALLBACK (on_modem_get_flight_mode),
- ctx);
-
- g_signal_connect (modem,
- "handle-get-version",
- G_CALLBACK (on_modem_get_version),
- ctx);
-
- g_signal_connect (modem,
- "handle-get-serial-number",
- G_CALLBACK (on_modem_get_serial_number),
- ctx);
-
- g_signal_connect (modem,
- "handle-get-imei",
- G_CALLBACK (on_modem_get_imei),
- ctx);
-
- g_signal_connect (modem,
- "handle-set-dun-pin-ctrl",
- G_CALLBACK (on_modem_set_dun_pin_ctrl),
- ctx);
-
- telephony_modem_set_power(modem, MODEM_STATE_UNKNOWN);
-
- return TRUE;
-}
-
-gboolean dbus_plugin_modem_response(struct custom_data *ctx, UserRequest *ur,
- struct dbus_request_info *dbus_info, enum tcore_response_command command,
- unsigned int data_len, const void *data)
-{
- dbg("Response!!! Command: [0x%x] CP Name: [%s]",
- command, GET_CP_NAME(dbus_info->invocation));
-
- switch (command) {
- case TRESP_MODEM_SET_FLIGHTMODE: {
- const struct tresp_modem_set_flightmode *resp_set_flight_mode = data;
- int info_set_flight_mode = 3; /* TAPI_POWER_FLIGHT_MODE_RESP_FAIL */
-
- dbg("TRESP_MODEM_SET_FLIGHTMODE - Result: [%s]",
- (resp_set_flight_mode->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"));
-
- if (resp_set_flight_mode->result == TCORE_RETURN_SUCCESS) {
- const struct treq_modem_set_flightmode *treq_data;
- treq_data = tcore_user_request_ref_data(ur, NULL);
- if (treq_data == NULL) {
- warn("No Request data!!!");
- info_set_flight_mode = 3; /* TAPI_POWER_FLIGHT_MODE_RESP_FAIL */
- }
- else if (treq_data->enable == TRUE) {
- info_set_flight_mode = 1; /* TAPI_POWER_FLIGHT_MODE_RESP_ON */
- } else {
- info_set_flight_mode = 2; /* TAPI_POWER_FLIGHT_MODE_RESP_OFF */
- }
- }
- dbg("Set Flight mode: [%s]", (info_set_flight_mode == 1 ? "ON"
- : (info_set_flight_mode == 2 ? "OFF" : "Request FAIL")));
-
- telephony_modem_complete_set_flight_mode(dbus_info->interface_object, dbus_info->invocation,
- info_set_flight_mode);
- }
- break;
-
- case TRESP_MODEM_GET_FLIGHTMODE: {
- const struct tresp_modem_get_flightmode *resp_get_flight_mode = data;
-
- dbg("TRESP_MODEM_GET_FLIGHTMODE - Result: [%s]",
- (resp_get_flight_mode->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"));
-
- telephony_modem_complete_get_flight_mode(dbus_info->interface_object, dbus_info->invocation,
- resp_get_flight_mode->enable, resp_get_flight_mode->result);
- }
- break;
-
- case TRESP_MODEM_POWER_ON: {
- dbg("TRESP_MODEM_POWER_ON");
-
- telephony_modem_complete_set_power(dbus_info->interface_object, dbus_info->invocation, 0);
- }
- break;
-
- case TRESP_MODEM_POWER_OFF: {
- dbg("TRESP_MODEM_POWER_OFF");
-
- telephony_modem_complete_set_power(dbus_info->interface_object, dbus_info->invocation, 0);
- }
- break;
-
- case TRESP_MODEM_POWER_RESET: {
- dbg("TRESP_MODEM_POWER_RESET");
-
- telephony_modem_complete_set_power(dbus_info->interface_object, dbus_info->invocation, 0);
- }
- break;
-
- case TRESP_MODEM_POWER_LOW: {
- dbg("TRESP_MODEM_POWER_LOW");
-
- telephony_modem_complete_set_power(dbus_info->interface_object, dbus_info->invocation, 0);
- }
- break;
-
- case TRESP_MODEM_GET_IMEI: {
- const struct tresp_modem_get_imei *resp_get_imei = data;
-
- dbg("TRESP_MODEM_GET_IMEI - Result: [%s]",
- (resp_get_imei->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"));
-
- telephony_modem_complete_get_imei(dbus_info->interface_object, dbus_info->invocation,
- resp_get_imei->result, resp_get_imei->imei);
- }
- break;
-
- case TRESP_MODEM_GET_SN: {
- const struct tresp_modem_get_sn *resp_get_sn = data;
-
- dbg("TRESP_MODEM_GET_SN - Result: [%s]",
- (resp_get_sn->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"));
-
- telephony_modem_complete_get_serial_number(dbus_info->interface_object, dbus_info->invocation,
- resp_get_sn->result, resp_get_sn->sn, resp_get_sn->meid, resp_get_sn->imei, resp_get_sn->imeisv);
- }
- break;
-
- case TRESP_MODEM_GET_VERSION: {
- const struct tresp_modem_get_version *resp_get_version = data;
-
- dbg("TRESP_MODEM_GET_VERSION - Result: [%s]",
- (resp_get_version->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"));
-
- telephony_modem_complete_get_version(dbus_info->interface_object, dbus_info->invocation,
- resp_get_version->result,
- resp_get_version->software,
- resp_get_version->hardware,
- resp_get_version->calibration,
- resp_get_version->product_code);
- }
- break;
-
- case TRESP_MODEM_SET_DUN_PIN_CONTROL: {
- const struct tresp_modem_set_dun_pin_control *resp_dun_pin_ctrl = data;
-
- dbg("TRESP_MODEM_SET_DUN_PIN_CONTROL - Result: [%s]",
- (resp_dun_pin_ctrl->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"));
-
- telephony_modem_complete_set_dun_pin_ctrl(dbus_info->interface_object, dbus_info->invocation,
- resp_dun_pin_ctrl->result);
- }
- break;
-
- default:
- err("Unhandled/Unknown Response!!!");
- break;
- }
-
- return TRUE;
-}
-
-gboolean dbus_plugin_modem_notification(struct custom_data *ctx, CoreObject *source,
- TelephonyObjectSkeleton *object, enum tcore_notification_command command,
- unsigned int data_len, const void *data)
-{
- TelephonyModem *modem;
-
- if (!object) {
- dbg("object is NULL");
- return FALSE;
- }
- dbg("Notification!!! Command: [0x%x] CP Name: [%s]",
- command, tcore_server_get_cp_name_by_plugin(tcore_object_ref_plugin(source)));
-
- modem = telephony_object_peek_modem(TELEPHONY_OBJECT(object));
- dbg("modem: [%p]", modem);
-
- switch (command) {
- case TNOTI_MODEM_POWER: {
- const struct tnoti_modem_power *info = data;
-
- dbg("TNOTI_MODEM_POWER - Modem state: [%d]", info->state);
-
- if (info->state > MODEM_STATE_MAX)
- break;
-
- telephony_modem_emit_power(modem, info->state);
- telephony_modem_set_power(modem, info->state);
- }
- break;
-
- case TNOTI_MODEM_DUN_PIN_CONTROL: {
- const struct tnoti_modem_dun_pin_control *pin = data;
-
- dbg("TNOTI_MODEM_DUN_PIN_CONTROL - Signal: [0x%2x] Status: [0x%2x]", pin->signal, pin->status);
-
- telephony_modem_emit_dun_pin_ctrl(modem, pin->signal, pin->status);
- }
- break;
-
- case TNOTI_MODEM_DUN_EXTERNAL_CALL: {
- dbg("TNOTI_MODEM_DUN_EXTERNAL_CALL");
-
- telephony_modem_emit_dun_external_call(modem, TRUE);
- }
- break;
-
- default:
- err("Unhandled/Unknown Notification!!!");
- break;
- }
-
- return TRUE;
-}
-
+++ /dev/null
-/*
- * tel-plugin-dbus-tapi
- *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <pthread.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <time.h>
-#include <glib.h>
-#include <gio/gio.h>
-
-#include <tcore.h>
-#include <server.h>
-#include <plugin.h>
-#include <hal.h>
-#include <communicator.h>
-#include <storage.h>
-#include <queue.h>
-#include <user_request.h>
-#include <co_network.h>
-#include <co_sim.h>
-#include <co_ps.h>
-
-#include "generated-code.h"
-#include "common.h"
-
-static int __convert_act_to_systemtype(enum telephony_network_access_technology act)
-{
- switch (act) {
- case NETWORK_ACT_UNKNOWN:
- return 0;
-
- case NETWORK_ACT_GSM:
- return 1;
-
- case NETWORK_ACT_GPRS:
- return 2;
-
- case NETWORK_ACT_EGPRS:
- return 3;
-
- case NETWORK_ACT_UMTS:
- return 5;
-
- case NETWORK_ACT_GSM_UTRAN:
- return 6;
-
- case NETWORK_ACT_IS95A:
- return 8;
-
- case NETWORK_ACT_IS95B:
- return 9;
-
- case NETWORK_ACT_CDMA_1X:
- return 10;
-
- case NETWORK_ACT_EVDO_REV0:
- return 11;
-
- case NETWORK_ACT_CDMA_1X_EVDO_REV0:
- return 12;
-
- case NETWORK_ACT_EVDO_REVA:
- return 13;
-
- case NETWORK_ACT_CDMA_1X_EVDO_REVA:
- return 14;
-
- case NETWORK_ACT_EVDV:
- return 15;
-
- case NETWORK_ACT_LTE:
- return 16;
-
- default:
- break;
- }
-
- return 0;
-}
-
-static void __update_network_name (TelephonyNetwork *network, CoreObject *o, const char *cp_name)
-{
- char *spnname = NULL, *nwname = NULL;
- enum telephony_network_service_type svc_type;
- enum telephony_network_access_technology svc_act;
- enum tcore_network_name_priority network_name_priority;
-
- tcore_network_get_service_type (o, &svc_type);
- if (svc_type != NETWORK_SERVICE_TYPE_3G) {
- telephony_network_set_ps_type (network, TELEPHONY_HSDPA_OFF);
- }
-
- tcore_network_get_access_technology (o, &svc_act);
- telephony_network_set_access_technology (network, __convert_act_to_systemtype(svc_act));
-
- tcore_network_get_network_name_priority (o, &network_name_priority);
- switch (network_name_priority) {
- case TCORE_NETWORK_NAME_PRIORITY_SPN:
- telephony_network_set_name_option (network, NETWORK_NAME_OPTION_SPN);
- break;
-
- case TCORE_NETWORK_NAME_PRIORITY_NETWORK:
- telephony_network_set_name_option (network, NETWORK_NAME_OPTION_OPERATOR);
- break;
-
- case TCORE_NETWORK_NAME_PRIORITY_ANY:
- telephony_network_set_name_option (network, NETWORK_NAME_OPTION_ANY);
- break;
-
- default:
- telephony_network_set_name_option (network, NETWORK_NAME_OPTION_NONE);
- break;
- }
-
- do {
- /* spn */
- spnname = tcore_network_get_network_name(o, TCORE_NETWORK_NAME_TYPE_SPN);
- if (spnname) {
- telephony_network_set_spn_name (network, spnname);
- }
-
- /* nitz */
- nwname = tcore_network_get_network_name(o, TCORE_NETWORK_NAME_TYPE_FULL);
- if (nwname && strlen(nwname) > 0) {
- info("[DBUSINFO][%s] SPN:[%s] FULL:[%s] prio:[%d] act:[%d] svc_type:[%d]",
- cp_name, spnname?spnname:"", nwname, network_name_priority, svc_act, svc_type);
- telephony_network_set_network_name (network, nwname);
- break;
- }
- else {
- g_free(nwname);
- nwname = tcore_network_get_network_name(o, TCORE_NETWORK_NAME_TYPE_SHORT);
- if (nwname) {
- info("[DBUSINFO][%s] SPN:[%s] SHORT:[%s] prio:[%d] act:[%d] svc_type:[%d]",
- cp_name, spnname?spnname:"", nwname, network_name_priority, svc_act, svc_type);
- telephony_network_set_network_name (network, nwname);
- break;
- }
- }
- info("[DBUSINFO][%s] NW name is not fixed yet. SPN:[%s] prio:[%d] act:[%d] svc_type:[%d]",
- cp_name, spnname?spnname:"", network_name_priority, svc_act, svc_type);
- }while(0);
- g_free(spnname);
- g_free(nwname);
-}
-
-static enum tcore_hook_return on_hook_ps_protocol_status(Server *s,
- CoreObject *source, enum tcore_notification_command command,
- unsigned int data_len, void *data, void *user_data)
-{
- const struct tnoti_ps_protocol_status *protocol_status = data;
-
- TelephonyObjectSkeleton *object;
- TelephonyNetwork *network = NULL;
- struct custom_data *ctx = user_data;
- const char *cp_name;
- char *path;
-
- enum telephony_ps_protocol_status ps_protocol_status = TELEPHONY_HSDPA_OFF;
-
- cp_name = tcore_server_get_cp_name_by_plugin(tcore_object_ref_plugin(source));
- if (cp_name == NULL) {
- err("CP name is NULL");
- return TCORE_HOOK_RETURN_CONTINUE;
- }
-
- info("[DBUSINFO][%s] PS_PROTOCOL_STATUS (status:[%d])", cp_name, protocol_status->status);
-
- path = g_strdup_printf("%s/%s", MY_DBUS_PATH, cp_name);
-
- /* Look-up Hash table for Object */
- object = g_hash_table_lookup(ctx->objects, path);
- g_free(path);
- if (object == NULL) {
- err("Object is NOT defined!!!");
- return TCORE_HOOK_RETURN_CONTINUE;
- }
-
- network = telephony_object_peek_network(TELEPHONY_OBJECT(object));
- if (network == NULL) {
- err("Network object is NULL!!!");
- return TCORE_HOOK_RETURN_CONTINUE;
- }
-
- if (telephony_network_get_service_type (network) < NETWORK_SERVICE_TYPE_2G) {
- telephony_network_set_ps_type(network, TELEPHONY_HSDPA_OFF);
- return TCORE_HOOK_RETURN_CONTINUE;
- }
-
- switch (protocol_status->status) {
- case TELEPHONY_HSDPA_OFF:
- ps_protocol_status = TELEPHONY_HSDPA_OFF;
- break;
-
- case TELEPHONY_HSDPA_ON:
- ps_protocol_status = TELEPHONY_HSDPA_ON;
- break;
-
- case TELEPHONY_HSUPA_ON:
- ps_protocol_status = TELEPHONY_HSUPA_ON;
- break;
-
- case TELEPHONY_HSPA_ON:
- ps_protocol_status = TELEPHONY_HSPA_ON;
- break;
-
- case TELEPHONY_HSPAP_ON:
- ps_protocol_status = TELEPHONY_HSPAP_ON;
- break;
- default:
- err("Unhandled protocol status!");
- break;
- }
-
- /* Check and Set - To avoid double update */
- if (telephony_network_get_ps_type(network) != (gint)ps_protocol_status)
- telephony_network_set_ps_type(network, ps_protocol_status);
-
- return TCORE_HOOK_RETURN_CONTINUE;
-}
-
-static gboolean
-on_network_search (TelephonyNetwork *network, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (!check_access_control (invocation, AC_NETWORK, "x"))
- return TRUE;
-
- ur = MAKE_UR(ctx, network, invocation);
-
- tcore_user_request_set_command(ur, TREQ_NETWORK_SEARCH);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_network_search_cancel (TelephonyNetwork *network, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (!check_access_control (invocation, AC_NETWORK, "x"))
- return TRUE;
-
- ur = MAKE_UR(ctx, network, invocation);
-
- tcore_user_request_set_command(ur, TREQ_NETWORK_SET_CANCEL_MANUAL_SEARCH);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_network_get_selection_mode (TelephonyNetwork *network, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (!check_access_control (invocation, AC_NETWORK, "r"))
- return TRUE;
-
- ur = MAKE_UR(ctx, network, invocation);
-
- tcore_user_request_set_command(ur, TREQ_NETWORK_GET_PLMN_SELECTION_MODE);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_network_set_selection_mode (TelephonyNetwork *network, GDBusMethodInvocation *invocation,
- gint mode, const gchar *plmn, gint act, gpointer user_data)
-{
- struct treq_network_set_plmn_selection_mode req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (!check_access_control (invocation, AC_NETWORK, "w"))
- return TRUE;
-
- memset(&req, 0, sizeof(struct treq_network_set_plmn_selection_mode));
-
- if (mode == 0) { /* Automatic */
- req.mode = NETWORK_SELECT_MODE_AUTOMATIC;
- }
- else if (mode == 1) { /* Manual */
- req.mode = NETWORK_SELECT_MODE_MANUAL;
- snprintf(req.plmn, 7, "%s", plmn);
- req.act = act;
- }
- else {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- return TRUE;
- }
- dbg("Mode: [%d] PLMN: [%s] AcT: [%d]", req.mode, req.plmn, req.act);
-
- ur = MAKE_UR(ctx, network, invocation);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_network_set_plmn_selection_mode), &req);
- tcore_user_request_set_command(ur, TREQ_NETWORK_SET_PLMN_SELECTION_MODE);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-
-static gboolean
-on_network_set_service_domain (TelephonyNetwork *network, GDBusMethodInvocation *invocation,
- gint domain, gpointer user_data)
-{
- struct treq_network_set_service_domain req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (!check_access_control (invocation, AC_NETWORK, "w"))
- return TRUE;
-
- ur = MAKE_UR(ctx, network, invocation);
-
- req.domain = domain;
-
- tcore_user_request_set_data(ur, sizeof(struct treq_network_set_service_domain), &req);
- tcore_user_request_set_command(ur, TREQ_NETWORK_SET_SERVICE_DOMAIN);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_network_get_service_domain (TelephonyNetwork *network, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (!check_access_control (invocation, AC_NETWORK, "r"))
- return TRUE;
-
- ur = MAKE_UR(ctx, network, invocation);
-
- tcore_user_request_set_command(ur, TREQ_NETWORK_GET_SERVICE_DOMAIN);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_network_set_band (TelephonyNetwork *network, GDBusMethodInvocation *invocation,
- gint band, gint mode, gpointer user_data)
-{
- struct treq_network_set_band req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (!check_access_control (invocation, AC_NETWORK, "w"))
- return TRUE;
-
- ur = MAKE_UR(ctx, network, invocation);
-
- req.mode = mode;
- req.band = band;
-
- tcore_user_request_set_data(ur, sizeof(struct treq_network_set_band), &req);
- tcore_user_request_set_command(ur, TREQ_NETWORK_SET_BAND);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_network_get_band (TelephonyNetwork *network, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (!check_access_control (invocation, AC_NETWORK, "r"))
- return TRUE;
-
- ur = MAKE_UR(ctx, network, invocation);
-
- tcore_user_request_set_command(ur, TREQ_NETWORK_GET_BAND);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_network_set_mode (TelephonyNetwork *network, GDBusMethodInvocation *invocation,
- gint mode, gpointer user_data)
-{
- struct treq_network_set_mode req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (!check_access_control (invocation, AC_NETWORK, "w"))
- return TRUE;
-
- ur = MAKE_UR(ctx, network, invocation);
-
- req.mode = mode;
-
- tcore_user_request_set_data(ur, sizeof(struct treq_network_set_mode), &req);
- tcore_user_request_set_command(ur, TREQ_NETWORK_SET_MODE);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_network_get_mode (TelephonyNetwork *network, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (!check_access_control (invocation, AC_NETWORK, "r"))
- return TRUE;
-
- ur = MAKE_UR(ctx, network, invocation);
-
- tcore_user_request_set_command(ur, TREQ_NETWORK_GET_MODE);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_network_set_preferred_plmn (TelephonyNetwork *network, GDBusMethodInvocation *invocation,
- gint mode, gint ef_index, gint act, const gchar *plmn, gpointer user_data)
-{
- struct treq_network_set_preferred_plmn req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (!check_access_control (invocation, AC_NETWORK, "w"))
- return TRUE;
-
- ur = MAKE_UR(ctx, network, invocation);
-
- req.operation = mode;
- req.ef_index = ef_index;
- req.act = act;
-
- memcpy(req.plmn, plmn, 6);
-
- if (strlen(plmn) <= 5) {
- req.plmn[5] = '#';
- }
-
- tcore_user_request_set_data(ur, sizeof(struct treq_network_set_preferred_plmn), &req);
- tcore_user_request_set_command(ur, TREQ_NETWORK_SET_PREFERRED_PLMN);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_network_get_preferred_plmn (TelephonyNetwork *network, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (!check_access_control (invocation, AC_NETWORK, "r"))
- return TRUE;
-
- ur = MAKE_UR(ctx, network, invocation);
-
- tcore_user_request_set_command(ur, TREQ_NETWORK_GET_PREFERRED_PLMN);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_network_get_serving_network (TelephonyNetwork *network, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (!check_access_control (invocation, AC_NETWORK, "r"))
- return TRUE;
-
- ur = MAKE_UR(ctx, network, invocation);
-
- tcore_user_request_set_command(ur, TREQ_NETWORK_GET_SERVING_NETWORK);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_network_get_neighboring_cell_info (TelephonyNetwork *network, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (!check_access_control (invocation, AC_NETWORK, "r"))
- return TRUE;
-
- ur = MAKE_UR(ctx, network, invocation);
-
- tcore_user_request_set_command(ur, TREQ_NETWORK_GET_NEIGHBORING_CELL_INFO);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_network_set_default_data_subscription (TelephonyNetwork *network, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (!check_access_control (invocation, AC_NETWORK, "w"))
- return TRUE;
-
- ur = MAKE_UR(ctx, network, invocation);
-
- tcore_user_request_set_command(ur, TREQ_NETWORK_SET_DEFAULT_DATA_SUBSCRIPTION);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_network_get_default_data_subscription (TelephonyNetwork *network, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (!check_access_control (invocation, AC_NETWORK, "r"))
- return TRUE;
-
- ur = MAKE_UR(ctx, network, invocation);
-
- tcore_user_request_set_command( ur, TREQ_NETWORK_GET_DEFAULT_DATA_SUBSCRIPTION );
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_network_set_default_subs(TelephonyNetwork *network, GDBusMethodInvocation *invocation,
- gint preferred_subscription, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur;
- TReturn ret = 0;
-
- if (!check_access_control (invocation, AC_NETWORK, "w"))
- return TRUE;
-
- ur = MAKE_UR(ctx, network, invocation);
-
- tcore_user_request_set_command( ur, TREQ_NETWORK_SET_DEFAULT_SUBSCRIPTION );
- ret = tcore_communicator_dispatch_request( ctx->comm, ur );
- if ( ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_network_get_default_subs(TelephonyNetwork *network, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur;
- TReturn ret = 0;
-
- if (!check_access_control (invocation, AC_NETWORK, "r"))
- return TRUE;
-
- ur = MAKE_UR(ctx, network, invocation);
-
- tcore_user_request_set_command( ur, TREQ_NETWORK_GET_DEFAULT_SUBSCRIPTION );
- ret = tcore_communicator_dispatch_request( ctx->comm, ur );
- if ( ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-gboolean dbus_plugin_setup_network_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx)
-{
- TelephonyNetwork *network;
-
- network = telephony_network_skeleton_new();
- telephony_object_skeleton_set_network(object, network);
- g_object_unref(network);
-
- g_signal_connect (network,
- "handle-search",
- G_CALLBACK (on_network_search),
- ctx);
-
- g_signal_connect (network,
- "handle-search-cancel",
- G_CALLBACK (on_network_search_cancel),
- ctx);
-
- g_signal_connect (network,
- "handle-set-selection-mode",
- G_CALLBACK (on_network_set_selection_mode),
- ctx);
-
- g_signal_connect (network,
- "handle-get-selection-mode",
- G_CALLBACK (on_network_get_selection_mode),
- ctx);
-
- g_signal_connect (network,
- "handle-set-service-domain",
- G_CALLBACK (on_network_set_service_domain),
- ctx);
-
- g_signal_connect (network,
- "handle-get-service-domain",
- G_CALLBACK (on_network_get_service_domain),
- ctx);
-
- g_signal_connect (network,
- "handle-set-band",
- G_CALLBACK (on_network_set_band),
- ctx);
-
- g_signal_connect (network,
- "handle-get-band",
- G_CALLBACK (on_network_get_band),
- ctx);
-
- g_signal_connect (network,
- "handle-set-mode",
- G_CALLBACK (on_network_set_mode),
- ctx);
-
- g_signal_connect (network,
- "handle-get-mode",
- G_CALLBACK (on_network_get_mode),
- ctx);
-
- g_signal_connect (network,
- "handle-set-preferred-plmn",
- G_CALLBACK (on_network_set_preferred_plmn),
- ctx);
-
- g_signal_connect (network,
- "handle-get-preferred-plmn",
- G_CALLBACK (on_network_get_preferred_plmn),
- ctx);
-
- g_signal_connect (network,
- "handle-get-serving-network",
- G_CALLBACK (on_network_get_serving_network),
- ctx);
-
- g_signal_connect (network,
- "handle-get-ngbr-cell-info",
- G_CALLBACK (on_network_get_neighboring_cell_info),
- ctx);
-
- g_signal_connect (network,
- "handle-set-default-data-subscription",
- G_CALLBACK (on_network_set_default_data_subscription),
- ctx);
-
- g_signal_connect (network,
- "handle-get-default-data-subscription",
- G_CALLBACK (on_network_get_default_data_subscription),
- ctx);
-
- g_signal_connect (network,
- "handle-set-default-subscription",
- G_CALLBACK (on_network_set_default_subs),
- ctx);
-
- g_signal_connect (network,
- "handle-get-default-subscription",
- G_CALLBACK (on_network_get_default_subs),
- ctx);
-
- tcore_server_add_notification_hook(ctx->server,
- TNOTI_PS_PROTOCOL_STATUS, on_hook_ps_protocol_status, ctx);
-
- return TRUE;
-}
-
-gboolean dbus_plugin_network_response(struct custom_data *ctx, UserRequest *ur,
- struct dbus_request_info *dbus_info, enum tcore_response_command command,
- unsigned int data_len, const void *data)
-{
- dbg("Response!!! Command: [0x%x] CP Name: [%s]",
- command, GET_CP_NAME(dbus_info->invocation));
-
- switch (command) {
- case TRESP_NETWORK_SEARCH: {
- const struct tresp_network_search *resp_network_search = data;
- GVariant *network_search_result = NULL;
- GVariantBuilder b;
- int i = 0;
-
- dbg("TRESP_NETWORK_SEARCH - Result: [%s] Count: [%d]",
- (resp_network_search->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"),
- resp_network_search->list_count);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- for (i = 0; i < resp_network_search->list_count; i++) {
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
-
- g_variant_builder_add(&b, "{sv}", "plmn", g_variant_new_string(resp_network_search->list[i].plmn));
- g_variant_builder_add(&b, "{sv}", "act", g_variant_new_int32(resp_network_search->list[i].act));
- g_variant_builder_add(&b, "{sv}", "type", g_variant_new_int32(resp_network_search->list[i].status));
- g_variant_builder_add(&b, "{sv}", "name", g_variant_new_string(resp_network_search->list[i].name));
-
- g_variant_builder_close(&b);
- }
- network_search_result = g_variant_builder_end(&b);
-
- telephony_network_complete_search(dbus_info->interface_object, dbus_info->invocation,
- network_search_result, resp_network_search->result);
- }
- break;
-
- case TRESP_NETWORK_SET_PLMN_SELECTION_MODE: {
- const struct tresp_network_set_plmn_selection_mode *resp_set_plmn_selection_mode = data;
-
- dbg("TRESP_SET_PLMN_SELECTION_MODE - Result: [%s]",
- (resp_set_plmn_selection_mode->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"));
-
- telephony_network_complete_set_selection_mode(dbus_info->interface_object, dbus_info->invocation,
- resp_set_plmn_selection_mode->result);
- }
- break;
-
- case TRESP_NETWORK_GET_PLMN_SELECTION_MODE: {
- const struct tresp_network_get_plmn_selection_mode *resp_get_plmn_selection_mode = data;
-
- dbg("TRESP_GET_PLMN_SELECTION_MODE - Result: [%s] Mode: [%s]",
- (resp_get_plmn_selection_mode->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"),
- (resp_get_plmn_selection_mode->mode == NETWORK_SELECT_MODE_AUTOMATIC ? "Auto" :
- (resp_get_plmn_selection_mode->mode == NETWORK_SELECT_MODE_MANUAL ? "Manual" :
- "Unknown")));
-
- switch (resp_get_plmn_selection_mode->mode) {
- case NETWORK_SELECT_MODE_AUTOMATIC:
- telephony_network_complete_get_selection_mode(dbus_info->interface_object, dbus_info->invocation,
- 0, resp_get_plmn_selection_mode->result);
- break;
-
- case NETWORK_SELECT_MODE_MANUAL:
- telephony_network_complete_get_selection_mode(dbus_info->interface_object, dbus_info->invocation,
- 1, resp_get_plmn_selection_mode->result);
- break;
-
- default:
- telephony_network_complete_get_selection_mode(dbus_info->interface_object, dbus_info->invocation,
- -1, resp_get_plmn_selection_mode->result);
- break;
- }
- }
- break;
-
- case TRESP_NETWORK_SET_SERVICE_DOMAIN: {
- const struct tresp_network_set_service_domain *resp_set_service_domain = data;
-
- dbg("TRESP_NETWORK_SET_SERVICE_DOMAIN - Result: [%s]",
- (resp_set_service_domain->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"));
-
- telephony_network_complete_set_service_domain(dbus_info->interface_object, dbus_info->invocation,
- resp_set_service_domain->result);
- }
- break;
-
- case TRESP_NETWORK_GET_SERVICE_DOMAIN: {
- const struct tresp_network_get_service_domain *resp_get_service_domain = data;
-
- dbg("TRESP_NETWORK_GET_SERVICE_DOMAIN - Result: [%s] Domain: [%d]",
- (resp_get_service_domain->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"),
- resp_get_service_domain->domain);
-
- telephony_network_complete_get_service_domain(dbus_info->interface_object, dbus_info->invocation,
- resp_get_service_domain->domain, resp_get_service_domain->result);
- }
- break;
-
- case TRESP_NETWORK_SET_BAND: {
- const struct tresp_network_set_band *resp_set_band = data;
-
- dbg("TRESP_NETWORK_SET_BAND - Result: [%s]",
- (resp_set_band->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"));
-
- telephony_network_complete_set_band(dbus_info->interface_object, dbus_info->invocation,
- resp_set_band->result);
- }
- break;
-
- case TRESP_NETWORK_GET_BAND: {
- const struct tresp_network_get_band *resp_get_band = data;
-
- dbg("TRESP_NETWORK_GET_BAND - Result: [%s] Mode: [%s] Band: [%d]",
- (resp_get_band->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"),
- (resp_get_band->mode == NETWORK_BAND_MODE_PREFERRED ? "Preferred" :
- (resp_get_band->mode == NETWORK_BAND_MODE_ONLY ? "Only" :
- "Unknown")), resp_get_band->band);
-
- telephony_network_complete_get_band(dbus_info->interface_object, dbus_info->invocation,
- resp_get_band->band, resp_get_band->mode, resp_get_band->result);
- }
- break;
-
- case TRESP_NETWORK_SET_MODE: {
- const struct tresp_network_set_mode *resp_set_mode = data;
-
- dbg("TRESP_NETWORK_SET_MODE - Result: [%s]",
- (resp_set_mode->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"));
-
- telephony_network_complete_set_mode(dbus_info->interface_object, dbus_info->invocation,
- resp_set_mode->result);
- }
- break;
-
- case TRESP_NETWORK_GET_MODE: {
- const struct tresp_network_get_mode *resp_get_mode = data;
-
- dbg("TRESP_NETWORK_GET_MODE - Result: [%s] Mode: [%d]",
- (resp_get_mode->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"),
- resp_get_mode->mode);
-
- telephony_network_complete_get_mode(dbus_info->interface_object, dbus_info->invocation,
- resp_get_mode->mode, resp_get_mode->result);
- }
- break;
-
- case TRESP_NETWORK_GET_NEIGHBORING_CELL_INFO: {
- const struct tresp_network_get_neighboring_cell_info *resp_get_ngbr_cell_info = data;
- GVariant *neighboring_cell_info_result = NULL;
- GVariant *value = NULL;
- GVariantBuilder b;
- enum telephony_network_access_technology act;
- int i = 0;
-
- dbg("TRESP_NETWORK_GET_NEIGHBORING_CELL_INFO - Result: [%s]",
- (resp_get_ngbr_cell_info->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"));
-
- act = resp_get_ngbr_cell_info->info.serving.act;
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- /* Fill Serving cell parameter */
- value = g_variant_new("(iii)",
- resp_get_ngbr_cell_info->info.serving.act,
- resp_get_ngbr_cell_info->info.serving.mcc,
- resp_get_ngbr_cell_info->info.serving.mnc);
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "serving", value);
- g_variant_builder_close(&b);
-
- if (act >= NETWORK_ACT_GSM && act <= NETWORK_ACT_EGPRS) {
- value = g_variant_new("(iiiii)",
- resp_get_ngbr_cell_info->info.serving.cell.geran.cell_id,
- resp_get_ngbr_cell_info->info.serving.cell.geran.lac,
- resp_get_ngbr_cell_info->info.serving.cell.geran.bcch,
- resp_get_ngbr_cell_info->info.serving.cell.geran.bsic,
- resp_get_ngbr_cell_info->info.serving.cell.geran.rxlev);
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "g_serving", value);
- g_variant_builder_close(&b);
-
- }
- else if (act >= NETWORK_ACT_UMTS && act <= NETWORK_ACT_GSM_UTRAN) {
- value = g_variant_new("(iiiii)",
- resp_get_ngbr_cell_info->info.serving.cell.umts.cell_id,
- resp_get_ngbr_cell_info->info.serving.cell.umts.lac,
- resp_get_ngbr_cell_info->info.serving.cell.umts.arfcn,
- resp_get_ngbr_cell_info->info.serving.cell.umts.psc,
- resp_get_ngbr_cell_info->info.serving.cell.umts.rscp);
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "u_serving", value);
- g_variant_builder_close(&b);
- }
- else if (act == NETWORK_ACT_LTE) {
- value = g_variant_new("(iiiii)",
- resp_get_ngbr_cell_info->info.serving.cell.lte.cell_id,
- resp_get_ngbr_cell_info->info.serving.cell.lte.lac,
- resp_get_ngbr_cell_info->info.serving.cell.lte.earfcn,
- resp_get_ngbr_cell_info->info.serving.cell.lte.tac,
- resp_get_ngbr_cell_info->info.serving.cell.lte.rssi);
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "l_serving", value);
- g_variant_builder_close(&b);
- }
-
- /* Fill GERAN neighbor cell parameter */
- for (i = 0; i < resp_get_ngbr_cell_info->info.geran_list_count; i++) {
- value = g_variant_new("(iiiii)",
- resp_get_ngbr_cell_info->info.geran_list[i].cell_id,
- resp_get_ngbr_cell_info->info.geran_list[i].lac,
- resp_get_ngbr_cell_info->info.geran_list[i].bcch,
- resp_get_ngbr_cell_info->info.geran_list[i].bsic,
- resp_get_ngbr_cell_info->info.geran_list[i].rxlev);
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "geran", value);
- g_variant_builder_close(&b);
- }
-
- /* Fill UMTS neighbor cell parameter */
- for (i = 0; i < resp_get_ngbr_cell_info->info.umts_list_count; i++) {
- value = g_variant_new("(iiiii)",
- resp_get_ngbr_cell_info->info.umts_list[i].cell_id,
- resp_get_ngbr_cell_info->info.umts_list[i].lac,
- resp_get_ngbr_cell_info->info.umts_list[i].arfcn,
- resp_get_ngbr_cell_info->info.umts_list[i].psc,
- resp_get_ngbr_cell_info->info.umts_list[i].rscp);
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "umts", value);
- g_variant_builder_close(&b);
- }
- neighboring_cell_info_result = g_variant_builder_end(&b);
-
- telephony_network_complete_get_ngbr_cell_info(dbus_info->interface_object, dbus_info->invocation,
- neighboring_cell_info_result, resp_get_ngbr_cell_info->result);
- }
- break;
-
- case TRESP_NETWORK_SET_PREFERRED_PLMN: {
- const struct tresp_network_set_preferred_plmn *resp_set_preferred_plmn = data;
-
- dbg("TRESP_NETWORK_SET_PREFERRED_PLMN - Result: [%s]",
- (resp_set_preferred_plmn->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"));
-
- telephony_network_complete_set_preferred_plmn(dbus_info->interface_object, dbus_info->invocation,
- resp_set_preferred_plmn->result);
- }
- break;
-
- case TRESP_NETWORK_GET_PREFERRED_PLMN: {
- const struct tresp_network_get_preferred_plmn *resp_get_preferred_plmn = data;
- GVariant *preferred_plmn_result = NULL;
- GVariantBuilder b;
- int i = 0;
-
- dbg("TRESP_NETWORK_GET_PREFERRED_PLMN - Result: [%s] Count: [%d]",
- (resp_get_preferred_plmn->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"),
- resp_get_preferred_plmn->list_count);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- for (i = 0; i < resp_get_preferred_plmn->list_count; i++) {
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
-
- g_variant_builder_add(&b, "{sv}", "plmn",
- g_variant_new_string(resp_get_preferred_plmn->list[i].plmn));
- g_variant_builder_add(&b, "{sv}", "act", g_variant_new_int32(resp_get_preferred_plmn->list[i].act));
- g_variant_builder_add(&b, "{sv}", "index",
- g_variant_new_int32(resp_get_preferred_plmn->list[i].ef_index));
- g_variant_builder_add(&b, "{sv}", "name", g_variant_new_string(resp_get_preferred_plmn->list[i].name));
-
- g_variant_builder_close(&b);
- }
- preferred_plmn_result = g_variant_builder_end(&b);
-
- telephony_network_complete_get_preferred_plmn(dbus_info->interface_object, dbus_info->invocation,
- preferred_plmn_result, resp_get_preferred_plmn->result);
- }
- break;
-
- case TRESP_NETWORK_SET_CANCEL_MANUAL_SEARCH: {
- const struct tresp_network_set_cancel_manual_search *resp_set_cancel_manual_search = data;
-
- dbg("TRESP_NETWORK_SET_CANCEL_MANUAL_SEARCH - Result: [%s]",
- (resp_set_cancel_manual_search->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"));
-
- telephony_network_complete_search_cancel(dbus_info->interface_object, dbus_info->invocation,
- resp_set_cancel_manual_search->result);
- }
- break;
-
- case TRESP_NETWORK_GET_SERVING_NETWORK: {
- const struct tresp_network_get_serving_network *resp_get_serving_network = data;
-
- dbg("TRESP_NETWORK_GET_SERVING_NETWORK - Result: [%s] AcT: [%d] PLMN: [%s] LAC: [%d])",
- (resp_get_serving_network->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"),
- resp_get_serving_network->act, resp_get_serving_network->plmn, resp_get_serving_network->gsm.lac);
-
- telephony_network_complete_get_serving_network(dbus_info->interface_object, dbus_info->invocation,
- resp_get_serving_network->act, resp_get_serving_network->plmn,
- resp_get_serving_network->gsm.lac, resp_get_serving_network->result);
- }
- break;
-
- case TRESP_NETWORK_SET_DEFAULT_DATA_SUBSCRIPTION: {
- const struct tresp_network_set_default_data_subscription *resp_set_default_data_subs = data;
-
- dbg("TRESP_NETWORK_SET_DEFAULT_SUBSCRIPTION - Result: [%s]",
- (resp_set_default_data_subs->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"));
-
- telephony_network_complete_set_default_data_subscription(dbus_info->interface_object, dbus_info->invocation,
- resp_set_default_data_subs->result);
- }
- break;
-
- case TRESP_NETWORK_GET_DEFAULT_DATA_SUBSCRIPTION: {
- const struct tresp_network_get_default_data_subs *resp_get_default_data_subs = data;
-
- dbg("TRESP_NETWORK_GET_DEFAULT_SUBSCRIPTION - Result: [%s] 'default' Data subscription: [%s]",
- (resp_get_default_data_subs->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"),
- (resp_get_default_data_subs->default_subs == NETWORK_DEFAULT_DATA_SUBS_SIM1 ? "SIM1" :
- (resp_get_default_data_subs->default_subs == NETWORK_DEFAULT_DATA_SUBS_SIM2 ? "SIM2" :
- "Unknown")));
-
- telephony_network_complete_get_default_data_subscription(dbus_info->interface_object, dbus_info->invocation,
- resp_get_default_data_subs->default_subs, resp_get_default_data_subs->result);
- }
- break;
-
- case TRESP_NETWORK_SET_DEFAULT_SUBSCRIPTION: {
- const struct tresp_network_set_default_subs *resp_set_default_subs = data;
-
- dbg("TRESP_NETWORK_SET_DEFAULT_SUBSCRIPTION - Result: [%s]",
- (resp_set_default_subs->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"));
-
- telephony_network_complete_set_default_subscription(dbus_info->interface_object, dbus_info->invocation,
- resp_set_default_subs->result );
- }
- break;
-
- case TRESP_NETWORK_GET_DEFAULT_SUBSCRIPTION: {
- const struct tresp_network_get_default_subs *resp_get_default_subs = data;
-
- dbg("TRESP_NETWORK_GET_DEFAULT_SUBSCRIPTION - Result: [%s] 'default' subscription: [%s]",
- (resp_get_default_subs->result == TCORE_RETURN_SUCCESS ? "Success" : "Fail"),
- (resp_get_default_subs->default_subs == NETWORK_DEFAULT_SUBS_SIM1 ? "SIM1" :
- (resp_get_default_subs->default_subs == NETWORK_DEFAULT_SUBS_SIM2 ? "SIM2" :
- "Unknown")));
-
- telephony_network_complete_get_default_subscription(dbus_info->interface_object, dbus_info->invocation,
- resp_get_default_subs->default_subs, resp_get_default_subs->result );
- }
- break;
-
- default:
- err("Unhandled/Unknown Response!!!");
- break;
- }
-
- return TRUE;
-}
-
-gboolean dbus_plugin_network_notification(struct custom_data *ctx, CoreObject *source,
- TelephonyObjectSkeleton *object, enum tcore_notification_command command,
- unsigned int data_len, const void *data)
-{
- TelephonyNetwork *network;
- const char *cp_name;
-
- cp_name = tcore_server_get_cp_name_by_plugin(tcore_object_ref_plugin(source));
-
- network = telephony_object_peek_network(TELEPHONY_OBJECT(object));
- if (network == NULL) {
- err("Network object is NULL!!!");
- return FALSE;
- }
-
- switch (command) {
- case TNOTI_NETWORK_REGISTRATION_STATUS: {
- const struct tnoti_network_registration_status *reg = data;
-
- info("[DBUSINFO][%s] NET_REGI_STATUS. (cs:[%d] ps:[%d] svc:[%d] roam:[%d])",
- cp_name, reg->cs_domain_status, reg->ps_domain_status, reg->service_type, reg->roaming_status);
-
-#ifdef ENABLE_KPI_LOGS
- /* We ignore No SIM present case for KPI */
- if (reg->cs_domain_status == NETWORK_SERVICE_DOMAIN_STATUS_FULL
- && telephony_network_get_circuit_status(network) != NETWORK_SERVICE_DOMAIN_STATUS_FULL)
- TIME_CHECK("[%s] CS Network Full", cp_name);
-
- if (reg->ps_domain_status == NETWORK_SERVICE_DOMAIN_STATUS_FULL
- && telephony_network_get_packet_status(network) != NETWORK_SERVICE_DOMAIN_STATUS_FULL)
- TIME_CHECK("[%s] PS Network Full", cp_name);
-#endif
-
- /* Update properties */
- telephony_network_set_circuit_status (network, reg->cs_domain_status);
- telephony_network_set_packet_status (network, reg->ps_domain_status);
- telephony_network_set_service_type (network, reg->service_type);
- telephony_network_set_roaming_status (network, reg->roaming_status);
-
- /* Update Network name */
- __update_network_name(network, source, cp_name);
-
- /* Emit Signal */
- telephony_network_emit_registration_status(network,
- reg->cs_domain_status,
- reg->ps_domain_status,
- reg->service_type,
- reg->roaming_status);
- }
- break;
-
- case TNOTI_NETWORK_CHANGE: {
- const struct tnoti_network_change *change = data;
-
- info("[DBUSINFO][%s] NET_CHANGE. (plmn:[%s] lac:[%d])",
- cp_name, change->plmn, change->gsm.lac);
-
- /* Update properties */
- telephony_network_set_plmn (network, change->plmn);
- telephony_network_set_lac (network, change->gsm.lac);
-
- /* Update Network name */
- __update_network_name(network, source, cp_name);
-
- /* Emit Signal */
- telephony_network_emit_change(network,
- change->act,
- change->plmn);
- }
- break;
-
- case TNOTI_NETWORK_TIMEINFO: {
- const struct tnoti_network_timeinfo *time_info = data;
-
- info("[DBUSINFO][%s] NET_TIMEINFO", cp_name);
-
- /* Emit signal */
- telephony_network_emit_time_info(network,
- time_info->year,
- time_info->month,
- time_info->day,
- time_info->hour,
- time_info->minute,
- time_info->second,
- time_info->wday,
- time_info->gmtoff,
- time_info->dstoff,
- time_info->isdst,
- time_info->plmn);
- }
- break;
-
- case TNOTI_NETWORK_ICON_INFO: {
- const struct tnoti_network_icon_info *icon_info = data;
-
- /* Update property */
- if (icon_info->type & NETWORK_ICON_INFO_RSSI) {
- info("[DBUSINFO][%s] NET_ICON_INFO (Ant:[%d])", cp_name, icon_info->rssi);
- telephony_network_set_sig_level (network, icon_info->rssi);
- }
- }
- break;
-
- case TNOTI_NETWORK_IDENTITY: {
- const struct tnoti_network_identity *identity = data;
-
- info("[DBUSINFO][%s] NET_IDENTITY (long:[%s] short:[%s] plmn:[%s])",
- cp_name, identity->full_name, identity->short_name, identity->plmn);
-
- /* Update properties */
- telephony_network_set_plmn (network, identity->plmn);
-
- /* Update Network name */
- __update_network_name (network, source, cp_name);
-
- /* Emit Signal */
- telephony_network_emit_identity(network,
- identity->plmn,
- identity->short_name,
- identity->full_name);
- }
- break;
-
- case TNOTI_NETWORK_LOCATION_CELLINFO: {
- const struct tnoti_network_location_cellinfo *location = data;
-
- info("[DBUSINFO][%s] NET_LOCATION_CELLINFO (lac:[%d] cell_id:[%d])",
- cp_name, location->lac, location->cell_id);
-
- /* Update properties */
- telephony_network_set_lac (network, location->lac);
- telephony_network_set_cell_id (network, location->cell_id);
-
- /* Emit signal */
- telephony_network_emit_cell_info(network,
- location->lac,
- location->cell_id);
- }
- break;
-
- case TNOTI_NETWORK_SIGNAL_STRENGTH: {
- const struct tnoti_network_signal_strength *signal_strength = data;
-
- info("[DBUSINFO][%s] NET_SIGNAL_STRENGTH (dbm:[%d])", cp_name, signal_strength->dbm);
-
- /* Update properties */
- telephony_network_set_sig_dbm (network, signal_strength->dbm);
-
- /* Emit signal */
- telephony_network_emit_signal_strength(network,
- signal_strength->dbm);
- }
- break;
-
- case TNOTI_NETWORK_DEFAULT_DATA_SUBSCRIPTION: {
- const struct tnoti_network_default_data_subs *default_data_subs_info = data;
-
- info("[DBUSINFO][%s] NET_DEFAULT_DATA_SUBSCRIPTION (default:[%d])", cp_name, default_data_subs_info->default_subs);
-
- /* Emit signal */
- telephony_network_emit_default_data_subscription(network,
- default_data_subs_info->default_subs);
- }
- break;
-
- case TNOTI_NETWORK_DEFAULT_SUBSCRIPTION: {
- const struct tnoti_network_default_subs *default_subs_info = data;
-
- info("[DBUSINFO][%s] NET_DEFAULT_SUBSCRIPTION (default:[%d])", cp_name, default_subs_info->default_subs);
-
- /* Emit signal */
- telephony_network_emit_default_subscription(network,
- default_subs_info->default_subs);
- }
- break;
-
- default:
- err("Unhandled/Unknown Notification!!!");
- break;
- }
-
- return TRUE;
-}
-
+++ /dev/null
-/*
- * tel-plugin-dbus-tapi
- *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
-
-#include <tcore.h>
-#include <server.h>
-#include <plugin.h>
-#include <hal.h>
-#include <communicator.h>
-#include <core_object.h>
-#include <queue.h>
-#include <user_request.h>
-#include <util.h>
-#include <co_phonebook.h>
-#include <co_sim.h>
-
-#include "generated-code.h"
-#include "common.h"
-#include "sat_manager.h"
-
-static const char* dbg_dbus_pb_type_name[] = {"PB_TYPE_FDN", "PB_TYPE_ADN", "PB_TYPE_SDN",
- "PB_TYPE_USIM", "PB_TYPE_AAS", "PB_TYPE_GAS", };
-static const char* dbg_dbus_pb_adf_field_name[] = { "NO VALUE 0", "PB_FIELD_NAME", "PB_FIELD_NUMBER",
- "PB_FIELD_ANR1", "PB_FIELD_ANR2", "PB_FIELD_ANR3", "PB_FIELD_EMAIL1",
- "PB_FIELD_EMAIL2", "PB_FIELD_EMAIL3", "PB_FIELD_EMAIL4", "PB_FIELD_SNE",
- "PB_FIELD_GRP", "PB_FIELD_PBC" };
-static const char* dbg_dbus_pb_ton_name[] = { "PB_TON_UNKNOWN", "PB_TON_INTERNATIONAL",
- "PB_TON_NATIONAL", "PB_TON_NETWORK_SPECIFIC", "PB_TON_DEDICATED_ACCESS",
- "PB_TON_ALPHA_NUMERIC", "PB_TON_ABBREVIATED_NUMBER",
- "PB_TON_RESERVED_FOR_EXT", };
-
-static gboolean on_phonebook_get_init_status(TelephonyPhonebook *phonebook, GDBusMethodInvocation *invocation, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- gboolean pb_status = FALSE;
- struct tel_phonebook_support_list *list = NULL;
- GSList *co_list = NULL;
- CoreObject *co_pb = NULL;
- TcorePlugin *plugin = NULL;
-
- if (!check_access_control (invocation, AC_PHONEBOOK, "r"))
- return TRUE;
-
- plugin = tcore_server_find_plugin(ctx->server, GET_CP_NAME(invocation));
- co_list = tcore_plugin_get_core_objects_bytype(plugin, CORE_OBJECT_TYPE_PHONEBOOK);
- if (!co_list) {
- dbg("error- co_list is NULL");
- FAIL_RESPONSE(invocation, DEFAULT_MSG_REQ_FAILED);
- return TRUE;
- }
- co_pb = (CoreObject *)co_list->data;
- g_slist_free(co_list);
-
- if (!co_pb) {
- dbg("error- co_pb is NULL");
- FAIL_RESPONSE(invocation, DEFAULT_MSG_REQ_FAILED);
- return TRUE;
- }
-
- pb_status = tcore_phonebook_get_status(co_pb);
- list = tcore_phonebook_get_support_list(co_pb);
-
- if (!list) {
- dbg("Supported phonebook list is NULL");
- FAIL_RESPONSE(invocation, DEFAULT_MSG_REQ_FAILED);
- return TRUE;
- }
-
- dbg("fdn[%d],adn[%d],sdn[%d],usim[%d],aas[%d],gas[%d]"
- ,list->b_fdn,list->b_adn,list->b_sdn,list->b_usim,list->b_aas,list->b_gas);
-
- telephony_phonebook_complete_get_init_status(phonebook, invocation,
- pb_status,
- list->b_fdn,
- list->b_adn,
- list->b_sdn,
- list->b_usim,
- list->b_aas,
- list->b_gas);
-
- g_free(list);
-
- return TRUE;
-}
-
-static gboolean on_phonebook_get_count(TelephonyPhonebook *phonebook, GDBusMethodInvocation *invocation, gint arg_req_type, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- struct treq_phonebook_get_count pb_count;
- TcorePlugin *plugin = NULL;
- GSList *co_list = NULL;
- CoreObject *co_pb = NULL;
- gboolean pb_status = FALSE;
-
- if (!check_access_control (invocation, AC_PHONEBOOK, "r"))
- return TRUE;
-
- plugin = tcore_server_find_plugin(ctx->server, GET_CP_NAME(invocation));
- co_list = tcore_plugin_get_core_objects_bytype(plugin, CORE_OBJECT_TYPE_PHONEBOOK);
- if (!co_list) {
- dbg("error- co_list is NULL");
- FAIL_RESPONSE(invocation, DEFAULT_MSG_REQ_FAILED);
- return TRUE;
- }
- co_pb = (CoreObject *)co_list->data;
- g_slist_free(co_list);
-
- pb_status = tcore_phonebook_get_status(co_pb);
-
- if(pb_status == FALSE) {
- dbg("pb_init is not completed yet.");
- telephony_phonebook_complete_get_count(phonebook, invocation, PB_ACCESS_CONDITION_NOT_SATISFIED, 0, 0, 0);
- return TRUE;
- }
-
- ur = MAKE_UR(ctx, phonebook, invocation);
- memset(&pb_count, 0, sizeof(struct treq_phonebook_get_count));
-
- pb_count.phonebook_type = arg_req_type;
- dbg("req phonebook_type[%d][%s]", pb_count.phonebook_type, dbg_dbus_pb_type_name[pb_count.phonebook_type]);
- tcore_user_request_set_data(ur, sizeof(struct treq_phonebook_get_count), &pb_count);
- tcore_user_request_set_command(ur, TREQ_PHONEBOOK_GETCOUNT);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE(invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
- return TRUE;
-}
-
-static gboolean on_phonebook_get_info(TelephonyPhonebook *phonebook, GDBusMethodInvocation *invocation, gint arg_req_type, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- struct treq_phonebook_get_info pb_info;
- TcorePlugin *plugin = NULL;
- GSList *co_list = NULL;
- CoreObject *co_pb = NULL;
- gboolean pb_status = FALSE;
-
- if (!check_access_control (invocation, AC_PHONEBOOK, "r"))
- return TRUE;
-
- plugin = tcore_server_find_plugin(ctx->server, GET_CP_NAME(invocation));
- co_list = tcore_plugin_get_core_objects_bytype(plugin, CORE_OBJECT_TYPE_PHONEBOOK);
- if (!co_list) {
- dbg("error- co_list is NULL");
- FAIL_RESPONSE(invocation, DEFAULT_MSG_REQ_FAILED);
- return TRUE;
- }
- co_pb = (CoreObject *)co_list->data;
- g_slist_free(co_list);
-
- pb_status = tcore_phonebook_get_status(co_pb);
-
- if(pb_status == FALSE) {
- dbg("pb_init is not completed yet.");
- telephony_phonebook_complete_get_info(phonebook, invocation, PB_ACCESS_CONDITION_NOT_SATISFIED, 0, 0, 0, 0, 0, 0);
- return TRUE;
- }
-
- ur = MAKE_UR(ctx, phonebook, invocation);
- memset(&pb_info, 0, sizeof(struct treq_phonebook_get_info));
-
- pb_info.phonebook_type = arg_req_type;
- dbg("req phonebook_type[%d][%s]", pb_info.phonebook_type, dbg_dbus_pb_type_name[pb_info.phonebook_type]);
- tcore_user_request_set_data(ur, sizeof(struct treq_phonebook_get_info), &pb_info);
- tcore_user_request_set_command(ur, TREQ_PHONEBOOK_GETMETAINFO);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_phonebook_get_usim_info(TelephonyPhonebook *phonebook, GDBusMethodInvocation *invocation, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- TcorePlugin *plugin = NULL;
- GSList *co_list = NULL;
- CoreObject *co_pb = NULL;
- gboolean pb_status = FALSE;
-
- if (!check_access_control (invocation, AC_PHONEBOOK, "r"))
- return TRUE;
-
- plugin = tcore_server_find_plugin(ctx->server, GET_CP_NAME(invocation));
- co_list = tcore_plugin_get_core_objects_bytype(plugin, CORE_OBJECT_TYPE_PHONEBOOK);
- if (!co_list) {
- dbg("error- co_list is NULL");
- FAIL_RESPONSE(invocation, DEFAULT_MSG_REQ_FAILED);
- return TRUE;
- }
- co_pb = (CoreObject *)co_list->data;
- g_slist_free(co_list);
-
- pb_status = tcore_phonebook_get_status(co_pb);
-
- if(pb_status == FALSE) {
- GVariant *gv = NULL;
- GVariantBuilder b;
- dbg("pb_init is not completed yet.");
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- gv = g_variant_builder_end(&b);
- telephony_phonebook_complete_get_usim_meta_info (phonebook, invocation, PB_ACCESS_CONDITION_NOT_SATISFIED, gv);
- return TRUE;
- }
-
- ur = MAKE_UR(ctx, phonebook, invocation);
- tcore_user_request_set_data(ur, 0, NULL);
- tcore_user_request_set_command(ur, TREQ_PHONEBOOK_GETUSIMINFO);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
- return TRUE;
-}
-
-static gboolean on_phonebook_read_record(TelephonyPhonebook *phonebook, GDBusMethodInvocation *invocation,
- gint arg_req_type, gint arg_index, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- struct treq_phonebook_read_record pb_read;
- TcorePlugin *plugin = NULL;
- GSList *co_list = NULL;
- CoreObject *co_pb = NULL;
- gboolean pb_status = FALSE;
-
- if (!check_access_control (invocation, AC_PHONEBOOK, "r"))
- return TRUE;
-
- plugin = tcore_server_find_plugin(ctx->server, GET_CP_NAME(invocation));
- co_list = tcore_plugin_get_core_objects_bytype(plugin, CORE_OBJECT_TYPE_PHONEBOOK);
- if (!co_list) {
- dbg("error- co_list is NULL");
- FAIL_RESPONSE(invocation, DEFAULT_MSG_REQ_FAILED);
- return TRUE;
- }
- co_pb = (CoreObject *)co_list->data;
- g_slist_free(co_list);
-
- pb_status = tcore_phonebook_get_status(co_pb);
-
- if(pb_status == FALSE) {
- dbg("pb_init is not completed yet.");
- telephony_phonebook_complete_read_record(phonebook, invocation, PB_ACCESS_CONDITION_NOT_SATISFIED,
- 0, 0, 0, NULL, 0, NULL, 0, NULL, 0, NULL, 0, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0);
- return TRUE;
- }
-
- ur = MAKE_UR(ctx, phonebook, invocation);
- memset(&pb_read, 0, sizeof(struct treq_phonebook_read_record));
-
- pb_read.index = (unsigned short)arg_index;
- pb_read.phonebook_type = arg_req_type;
- dbg("req phonebook_type[%d][%s] index[%d]",
- pb_read.phonebook_type, dbg_dbus_pb_type_name[pb_read.phonebook_type], pb_read.index);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_phonebook_read_record), &pb_read);
- tcore_user_request_set_command(ur, TREQ_PHONEBOOK_READRECORD);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
- return TRUE;
-}
-
-static gboolean on_phonebook_update_record(TelephonyPhonebook *phonebook, GDBusMethodInvocation *invocation,
- gint arg_type, gint arg_index, const gchar *arg_name, gint arg_dcs,
- const gchar *arg_number, gint arg_ton,
- const gchar *arg_sne, gint arg_sne_dcs,
- const gchar *arg_number2, gint arg_number2_ton,
- const gchar *arg_number3,gint arg_number3_ton, const gchar *arg_number4, gint arg_number4_ton,
- const gchar *arg_email1, const gchar *arg_email2, const gchar *arg_email3, const gchar *arg_email4,
- gint arg_group_index, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- struct treq_phonebook_update_record pb_update;
- TcorePlugin *plugin = NULL;
- GSList *co_list = NULL;
- CoreObject *co_pb = NULL;
- gboolean pb_status = FALSE;
- int temp_len = 0;
-
- if (!check_access_control (invocation, AC_PHONEBOOK, "x"))
- return TRUE;
-
- plugin = tcore_server_find_plugin(ctx->server, GET_CP_NAME(invocation));
- co_list = tcore_plugin_get_core_objects_bytype(plugin, CORE_OBJECT_TYPE_PHONEBOOK);
- if (!co_list) {
- dbg("error- co_list is NULL");
- FAIL_RESPONSE(invocation, DEFAULT_MSG_REQ_FAILED);
- return TRUE;
- }
- co_pb = (CoreObject *)co_list->data;
- g_slist_free(co_list);
-
- pb_status = tcore_phonebook_get_status(co_pb);
-
- if(pb_status == FALSE) {
- dbg("pb_init is not completed yet.");
- telephony_phonebook_complete_update_record(phonebook, invocation, PB_ACCESS_CONDITION_NOT_SATISFIED);
- return TRUE;
- }
-
- memset(&pb_update, 0, sizeof(struct treq_phonebook_update_record));
-
- dbg("pb_type[%d] index[%d] name[%s] number[%s] email[%s]",
- arg_type,arg_index,arg_name, arg_number, arg_email1);
-
- pb_update.index = (unsigned short)arg_index;
- pb_update.phonebook_type = arg_type;
-
- if(arg_name != NULL && strlen(arg_name)){
- pb_update.dcs = PB_TEXT_ASCII;
- pb_update.name_len = strlen(arg_name);
- if(pb_update.name_len > PHONEBOOK_NAME_BYTE_MAX)
- pb_update.name_len = PHONEBOOK_NAME_BYTE_MAX;
- memcpy(pb_update.name, arg_name, pb_update.name_len);
- }
- if(arg_sne != NULL && strlen(arg_sne)){
- pb_update.sne_dcs = PB_TEXT_ASCII;
- pb_update.sne_len = strlen(arg_sne);
- if(pb_update.sne_len > PHONEBOOK_NAME_BYTE_MAX)
- pb_update.sne_len = PHONEBOOK_NAME_BYTE_MAX;
- memcpy(pb_update.sne, arg_sne, pb_update.sne_len);
- }
- if(arg_number != NULL && (temp_len=strlen(arg_number))){
- pb_update.ton = arg_ton;
- if(temp_len > PHONEBOOK_NUMBER_BYTE_MAX)
- temp_len = PHONEBOOK_NUMBER_BYTE_MAX;
- memcpy(pb_update.number, arg_number, temp_len);
- }
- if(arg_number2 != NULL && (temp_len=strlen(arg_number2))){
- pb_update.anr1_ton = arg_number2_ton;
- if(temp_len > PHONEBOOK_NUMBER_BYTE_MAX)
- temp_len = PHONEBOOK_NUMBER_BYTE_MAX;
- memcpy(pb_update.anr1, arg_number2, temp_len);
- }
-
- if(arg_number3 != NULL && (temp_len=strlen(arg_number3))){
- pb_update.anr2_ton = arg_number3_ton;
- if(temp_len > PHONEBOOK_NUMBER_BYTE_MAX)
- temp_len = PHONEBOOK_NUMBER_BYTE_MAX;
- memcpy(pb_update.anr2, arg_number3, temp_len);
- }
-
- if(arg_number4 != NULL && (temp_len=strlen(arg_number4))){
- pb_update.anr3_ton = arg_number4_ton;
- if(temp_len > PHONEBOOK_NUMBER_BYTE_MAX)
- temp_len = PHONEBOOK_NUMBER_BYTE_MAX;
- memcpy(pb_update.anr3, arg_number4, temp_len);
- }
-
- if(arg_email1 != NULL && strlen(arg_email1)){
- pb_update.email1_len = strlen(arg_email1);
- if(pb_update.email1_len > PHONEBOOK_EMAIL_BYTE_MAX)
- pb_update.email1_len = PHONEBOOK_EMAIL_BYTE_MAX;
- memcpy(pb_update.email1, arg_email1, pb_update.email1_len);
- }
- /* Additional e-mail fields (email 2,3,4) cannot be used to CP*/
-
- pb_update.group_index = (unsigned short)arg_group_index;
-
- ur = MAKE_UR(ctx, phonebook, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_phonebook_update_record), &pb_update);
- tcore_user_request_set_command(ur, TREQ_PHONEBOOK_UPDATERECORD);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_phonebook_delete_record(TelephonyPhonebook *phonebook, GDBusMethodInvocation *invocation,
- gint arg_type, gint arg_index, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- struct treq_phonebook_delete_record pb_delete;
- TcorePlugin *plugin = NULL;
- GSList *co_list = NULL;
- CoreObject *co_pb = NULL;
- gboolean pb_status = FALSE;
-
- if (!check_access_control (invocation, AC_PHONEBOOK, "x"))
- return TRUE;
-
- plugin = tcore_server_find_plugin(ctx->server, GET_CP_NAME(invocation));
- co_list = tcore_plugin_get_core_objects_bytype(plugin, CORE_OBJECT_TYPE_PHONEBOOK);
- if (!co_list) {
- dbg("error- co_list is NULL");
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- return TRUE;
- }
- co_pb = (CoreObject *)co_list->data;
- g_slist_free(co_list);
-
- pb_status = tcore_phonebook_get_status(co_pb);
-
- if(pb_status == FALSE) {
- dbg("pb_init is not completed yet.");
- telephony_phonebook_complete_delete_record(phonebook, invocation, PB_ACCESS_CONDITION_NOT_SATISFIED);
- return TRUE;
- }
-
- ur = MAKE_UR(ctx, phonebook, invocation);
- memset(&pb_delete, 0, sizeof(struct treq_phonebook_delete_record));
-
- pb_delete.index = (unsigned short)arg_index;
- pb_delete.phonebook_type = arg_type;
- dbg("req phonebook_type[%d][%s] index[%d]",
- pb_delete.phonebook_type, dbg_dbus_pb_type_name[pb_delete.phonebook_type], pb_delete.index);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_phonebook_delete_record), &pb_delete);
- tcore_user_request_set_command(ur, TREQ_PHONEBOOK_DELETERECORD);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-gboolean dbus_plugin_setup_phonebook_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx)
-{
- TelephonyPhonebook *phonebook;
-
- phonebook = telephony_phonebook_skeleton_new();
- telephony_object_skeleton_set_phonebook(object, phonebook);
- g_object_unref(phonebook);
-
- dbg("phonebook = %p", phonebook);
-
- g_signal_connect (phonebook,
- "handle-get-init-status",
- G_CALLBACK (on_phonebook_get_init_status),
- ctx);
-
- g_signal_connect (phonebook,
- "handle-get-count",
- G_CALLBACK (on_phonebook_get_count),
- ctx);
-
- g_signal_connect (phonebook,
- "handle-get-info",
- G_CALLBACK (on_phonebook_get_info),
- ctx);
-
- g_signal_connect (phonebook,
- "handle-get-usim-meta-info",
- G_CALLBACK (on_phonebook_get_usim_info),
- ctx);
-
- g_signal_connect (phonebook,
- "handle-read-record",
- G_CALLBACK (on_phonebook_read_record),
- ctx);
-
- g_signal_connect (phonebook,
- "handle-update-record",
- G_CALLBACK (on_phonebook_update_record),
- ctx);
-
- g_signal_connect (phonebook,
- "handle-delete-record",
- G_CALLBACK (on_phonebook_delete_record),
- ctx);
-
- return TRUE;
-}
-
-gboolean dbus_plugin_phonebook_response(struct custom_data *ctx, UserRequest *ur,
- struct dbus_request_info *dbus_info, enum tcore_response_command command,
- unsigned int data_len, const void *data)
-{
- const struct tresp_phonebook_get_count *resp_pbcnt = data;
- const struct tresp_phonebook_get_info *resp_entry = data;
- const struct tresp_phonebook_get_usim_info *resp_capa = data;
- const struct tresp_phonebook_read_record *resp_pbread = data;
- const struct tresp_phonebook_update_record *resp_pbupdate = data;
- const struct tresp_phonebook_delete_record *resp_pbdelete = data;
-
- switch (command) {
- case TRESP_PHONEBOOK_GETCOUNT:
- dbg("GETCOUNT (type[%d][%s] used[%d]total[%d])",
- resp_pbcnt->type, dbg_dbus_pb_type_name[resp_pbcnt->type],
- resp_pbcnt->used_count, resp_pbcnt->total_count);
- telephony_phonebook_complete_get_count(dbus_info->interface_object, dbus_info->invocation,
- resp_pbcnt->result, resp_pbcnt->type, resp_pbcnt->used_count, resp_pbcnt->total_count);
- break;
-
- case TRESP_PHONEBOOK_GETMETAINFO:
- dbg("GETMETAINFO (type[%d][%s])", resp_entry->type, dbg_dbus_pb_type_name[resp_entry->type]);
- dbg("index(min[%d]max[%d]), num_max[%d] text(max[%d]used[%d])",
- resp_entry->index_min, resp_entry->index_max, resp_entry->number_length_max, resp_entry->text_length_max, resp_entry->used_count);
- telephony_phonebook_complete_get_info(dbus_info->interface_object, dbus_info->invocation,
- resp_entry->result, resp_entry->type, resp_entry->index_min, resp_entry->index_max,
- resp_entry->number_length_max, resp_entry->text_length_max, resp_entry->used_count);
- break;
-
- case TRESP_PHONEBOOK_GETUSIMINFO:{
- GVariant *gv = NULL;
- GVariantBuilder b;
- int i;
- dbg("GETUSIMINFO");
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for(i=0;i < resp_capa->field_count; i++){
- g_variant_builder_open(&b,G_VARIANT_TYPE("a{sv}"));
- dbg("type[%d][%s] index_max[%d] text_max[%d] used_count[%d]",
- resp_capa->field_list[i].field,
- dbg_dbus_pb_adf_field_name[resp_capa->field_list[i].field],
- resp_capa->field_list[i].index_max,
- resp_capa->field_list[i].text_max,
- resp_capa->field_list[i].used_count);
- g_variant_builder_add(&b, "{sv}", "field_type", g_variant_new_int32(resp_capa->field_list[i].field));
- g_variant_builder_add(&b, "{sv}", "index_max", g_variant_new_int32(resp_capa->field_list[i].index_max));
- g_variant_builder_add(&b, "{sv}", "text_max", g_variant_new_int32(resp_capa->field_list[i].text_max));
- g_variant_builder_add(&b, "{sv}", "used_count", g_variant_new_int32(resp_capa->field_list[i].used_count));
- g_variant_builder_close(&b);
- }
- gv = g_variant_builder_end(&b);
-
- telephony_phonebook_complete_get_usim_meta_info (dbus_info->interface_object, dbus_info->invocation,
- resp_capa->result,
- gv);
- }
- break;
-
- case TRESP_PHONEBOOK_READRECORD: {
- unsigned char dest_pb_name[PHONEBOOK_NAME_BYTE_MAX + 1];
- unsigned char dest_pb_sne[PHONEBOOK_NAME_BYTE_MAX + 1];
- unsigned char dest_pb_email1[PHONEBOOK_EMAIL_BYTE_MAX + 1];
- memset(dest_pb_name, 0x00, PHONEBOOK_NAME_BYTE_MAX + 1);
- memset(dest_pb_sne, 0x00, PHONEBOOK_NAME_BYTE_MAX + 1);
- memset(dest_pb_email1, 0x00, PHONEBOOK_EMAIL_BYTE_MAX + 1);
- /* Additional e-mail fields (email 2,3,4) cannot be used to CP*/
-
- dbg("READRECORD (type[%d][%s] index[%d][%d])",
- resp_pbread->phonebook_type, dbg_dbus_pb_type_name[resp_pbread->phonebook_type], resp_pbread->index,resp_pbread->next_index);
-
- if (resp_pbread->name_len > 0) {
- dbg("name:[%s] len:[%d]",resp_pbread->name, resp_pbread->name_len);
- memcpy(dest_pb_name,resp_pbread->name,resp_pbread->name_len);
- }
-
- dbg("number:[%s] ton:[%d][%s])",
- resp_pbread->number,resp_pbread->ton, dbg_dbus_pb_ton_name[resp_pbread->ton] );
-
- if(resp_pbread->phonebook_type == PB_TYPE_USIM) {
- if (resp_pbread->sne_len > 0) {
- dbg("sne:[%s] sne_len:[%d]", resp_pbread->sne,resp_pbread->sne_len);
- memcpy(dest_pb_sne,resp_pbread->sne,resp_pbread->sne_len);
- }
-
- if (strlen((const char*)resp_pbread->anr1) != 0 || strlen((const char*)resp_pbread->anr2) != 0 || strlen((const char*)resp_pbread->anr3) != 0) {
- dbg("anr1:([%s],ton[%d][%s])",resp_pbread->anr1,resp_pbread->anr1_ton, dbg_dbus_pb_ton_name[resp_pbread->anr1_ton]);
- dbg("anr2:([%s],ton[%d][%s])",resp_pbread->anr2,resp_pbread->anr2_ton, dbg_dbus_pb_ton_name[resp_pbread->anr2_ton]);
- dbg("anr3:([%s],ton[%d][%s])",resp_pbread->anr3,resp_pbread->anr3_ton, dbg_dbus_pb_ton_name[resp_pbread->anr3_ton]);
- }
- if (resp_pbread->email1_len > 0) {
- dbg("email1:[%s] len:[%d]",resp_pbread->email1, resp_pbread->email1_len);
- memcpy(dest_pb_email1, resp_pbread->email1, resp_pbread->email1_len);
- }
- /* Additional e-mail fields (email 2,3,4) cannot be used to CP*/
- }
-
- /*
- * Check whether NAME, SNE string values are invalid utf-8 string or not,
- * because if invalid it will be converted to "[INVALID UTF-8]" automatically by g_variant_new_string().
- */
- if (g_utf8_validate((const gchar *)dest_pb_name, -1, NULL) == FALSE) {
- tcore_util_hex_dump("[INVALID_UTF8_NAME] ", strlen((const char*)dest_pb_name), dest_pb_name);
- dbg("Empty NAME field.");
- memset(dest_pb_name, 0x00, PHONEBOOK_NAME_BYTE_MAX + 1);
- }
- if(resp_pbread->phonebook_type == PB_TYPE_USIM) {
- if (g_utf8_validate((const gchar *)dest_pb_sne, -1, NULL) == FALSE) {
- tcore_util_hex_dump("[INVALID_UTF8_SNE] ", strlen((const char*)dest_pb_sne), dest_pb_sne);
- dbg("Empty SNE field.");
- memset(dest_pb_sne, 0x00, PHONEBOOK_NAME_BYTE_MAX + 1);
- }
- }
-
- telephony_phonebook_complete_read_record(dbus_info->interface_object, dbus_info->invocation,
- resp_pbread->result, resp_pbread->phonebook_type, resp_pbread->index, resp_pbread->next_index,
- (const gchar *)dest_pb_name, resp_pbread->dcs,
- (const gchar *)resp_pbread->number, resp_pbread->ton,
- (const gchar *)dest_pb_sne, resp_pbread->sne_dcs,
- (const gchar *)resp_pbread->anr1, resp_pbread->anr1_ton,
- (const gchar *)resp_pbread->anr2, resp_pbread->anr2_ton,
- (const gchar *)resp_pbread->anr3, resp_pbread->anr3_ton,
- (const gchar *)dest_pb_email1,
- (const gchar *)resp_pbread->email2,
- (const gchar *)resp_pbread->email3,
- (const gchar *)resp_pbread->email4,
- resp_pbread->group_index);
-
- } break;
-
- case TRESP_PHONEBOOK_UPDATERECORD:
- dbg("UPDATERECORD (result[%d])", resp_pbupdate->result);
- telephony_phonebook_complete_update_record(dbus_info->interface_object, dbus_info->invocation,resp_pbupdate->result);
- break;
-
- case TRESP_PHONEBOOK_DELETERECORD:
- dbg("DELETERECORD (result[%d])", resp_pbdelete->result);
- telephony_phonebook_complete_delete_record(dbus_info->interface_object, dbus_info->invocation, resp_pbdelete->result);
- break;
-
- default:
- dbg("not handled cmd[0x%x]", command);
- break;
- }
-
- return TRUE;
-}
-
-gboolean dbus_plugin_phonebook_notification(struct custom_data *ctx, CoreObject *source,
- TelephonyObjectSkeleton *object, enum tcore_notification_command command,
- unsigned int data_len, const void *data)
-{
- TelephonyPhonebook *phonebook;
- const struct tnoti_phonebook_status *n_pb_status = data;
- const char *cp_name;
-
- cp_name = tcore_server_get_cp_name_by_plugin(tcore_object_ref_plugin(source));
-
- phonebook = telephony_object_peek_phonebook(TELEPHONY_OBJECT(object));
- switch (command) {
- case TNOTI_PHONEBOOK_STATUS :
-
-#ifdef ENABLE_KPI_LOGS
- if (n_pb_status->b_init == TRUE)
- TIME_CHECK("[%s] PBM Service Ready", cp_name);
-#endif
-
- telephony_phonebook_emit_status(phonebook,
- n_pb_status->b_init,
- n_pb_status->support_list.b_fdn,
- n_pb_status->support_list.b_adn,
- n_pb_status->support_list.b_sdn,
- n_pb_status->support_list.b_usim,
- n_pb_status->support_list.b_aas,
- n_pb_status->support_list.b_gas);
-
- break;
-
- default:
- dbg("not handled cmd[0x%x]", command);
- break;
- }
-
- return TRUE;
-}
+++ /dev/null
-/*
- * tel-plugin-dbus-tapi
- *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
-
-#include <tcore.h>
-#include <server.h>
-#include <plugin.h>
-#include <hal.h>
-#include <communicator.h>
-#include <core_object.h>
-#include <queue.h>
-#include <user_request.h>
-#include <util.h>
-#include <co_sap.h>
-#include <co_sim.h>
-
-#include "generated-code.h"
-#include "common.h"
-
-static gboolean on_sap_connect(TelephonySap *sap, GDBusMethodInvocation *invocation,
- gint arg_req_max_size, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- struct treq_sap_req_connect req_conn;
-
- if (!check_access_control (invocation, AC_SAP, "x"))
- return TRUE;
-
- ur = MAKE_UR(ctx, sap, invocation);
- memset(&req_conn, 0, sizeof(struct treq_sap_req_connect));
-
- req_conn.max_msg_size = (unsigned short)arg_req_max_size;
-
- tcore_user_request_set_data(ur, sizeof(struct treq_sap_req_connect), &req_conn);
- tcore_user_request_set_command(ur, TREQ_SAP_REQ_CONNECT);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sap_disconnect(TelephonySap *sap, GDBusMethodInvocation *invocation, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (!check_access_control (invocation, AC_SAP, "x"))
- return TRUE;
-
- ur = MAKE_UR(ctx, sap, invocation);
-
- tcore_user_request_set_command(ur, TREQ_SAP_REQ_DISCONNECT);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sap_get_status(TelephonySap *sap, GDBusMethodInvocation *invocation, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (!check_access_control (invocation, AC_SAP, "r"))
- return TRUE;
-
- ur = MAKE_UR(ctx, sap, invocation);
-
- tcore_user_request_set_command(ur, TREQ_SAP_REQ_STATUS);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sap_get_atr(TelephonySap *sap, GDBusMethodInvocation *invocation, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (!check_access_control (invocation, AC_SAP, "r"))
- return TRUE;
-
- ur = MAKE_UR(ctx, sap, invocation);
-
- tcore_user_request_set_command(ur, TREQ_SAP_REQ_ATR);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sap_transfer_apdu(TelephonySap *sap, GDBusMethodInvocation *invocation,
- GVariant *arg_req_apdu, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- struct treq_sap_transfer_apdu t_apdu;
- TReturn ret;
- GVariantIter *iter = NULL;
- GVariant *inner_gv = NULL;
- guchar rt_i;
- int i =0;
-
- dbg("Func Entrance");
-
- if (!check_access_control (invocation, AC_SAP, "x"))
- return TRUE;
-
- memset(&t_apdu, 0, sizeof(struct treq_sap_transfer_apdu));
-
- inner_gv = g_variant_get_variant(arg_req_apdu);
-
- g_variant_get(inner_gv, "ay", &iter);
- while ( g_variant_iter_loop (iter, "y", &rt_i)) {
- t_apdu.apdu_data[i] = rt_i;
- i++;
- }
- t_apdu.apdu_length = (unsigned int)i;
- g_variant_iter_free(iter);
- g_variant_unref(inner_gv);
- g_variant_unref(arg_req_apdu);
-
- for(i=0; i < (int)t_apdu.apdu_length; i++)
- dbg("apdu[%d][0x%02x]",i, t_apdu.apdu_data[i]);
-
- ur = MAKE_UR(ctx, sap, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sap_transfer_apdu), &t_apdu);
- tcore_user_request_set_command(ur, TREQ_SAP_TRANSFER_APDU);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sap_set_protocol(TelephonySap *sap, GDBusMethodInvocation *invocation,
- gint arg_protocol, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- struct treq_sap_set_protocol set_protocol;
-
- if (!check_access_control (invocation, AC_SAP, "w"))
- return TRUE;
-
- ur = MAKE_UR(ctx, sap, invocation);
- memset(&set_protocol, 0, sizeof(struct treq_sap_set_protocol));
-
- set_protocol.protocol = arg_protocol;
-
- tcore_user_request_set_data(ur, sizeof(struct treq_sap_set_protocol), &set_protocol);
- tcore_user_request_set_command(ur, TREQ_SAP_SET_PROTOCOL);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sap_set_power(TelephonySap *sap, GDBusMethodInvocation *invocation,
- gint arg_mode, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- struct treq_sap_set_power set_power;
-
- if (!check_access_control (invocation, AC_SAP, "w"))
- return TRUE;
-
- ur = MAKE_UR(ctx, sap, invocation);
- memset(&set_power, 0, sizeof(struct treq_sap_set_power));
-
- set_power.mode = arg_mode;
-
- tcore_user_request_set_data(ur, sizeof(struct treq_sap_set_power), &set_power);
- tcore_user_request_set_command(ur, TREQ_SAP_SET_POWER);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sap_get_card_reader_status(TelephonySap *sap, GDBusMethodInvocation *invocation, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (!check_access_control (invocation, AC_SAP, "r"))
- return TRUE;
-
- ur = MAKE_UR(ctx, sap, invocation);
-
- tcore_user_request_set_command(ur, TREQ_SAP_REQ_CARDREADERSTATUS);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-gboolean dbus_plugin_setup_sap_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx)
-{
- TelephonySap *sap;
-
- sap = telephony_sap_skeleton_new();
- telephony_object_skeleton_set_sap(object, sap);
- g_object_unref(sap);
-
- dbg("sap = %p", sap);
-
- g_signal_connect (sap,
- "handle-connect",
- G_CALLBACK (on_sap_connect),
- ctx);
-
- g_signal_connect (sap,
- "handle-disconnect",
- G_CALLBACK (on_sap_disconnect),
- ctx);
-
- g_signal_connect (sap,
- "handle-get-status",
- G_CALLBACK (on_sap_get_status),
- ctx);
-
- g_signal_connect (sap,
- "handle-get-atr",
- G_CALLBACK (on_sap_get_atr),
- ctx);
-
- g_signal_connect (sap,
- "handle-transfer-apdu",
- G_CALLBACK (on_sap_transfer_apdu),
- ctx);
-
- g_signal_connect (sap,
- "handle-set-protocol",
- G_CALLBACK (on_sap_set_protocol),
- ctx);
-
- g_signal_connect (sap,
- "handle-set-power",
- G_CALLBACK (on_sap_set_power),
- ctx);
-
- g_signal_connect (sap,
- "handle-get-card-reader-status",
- G_CALLBACK (on_sap_get_card_reader_status),
- ctx);
-
- return TRUE;
-}
-
-gboolean dbus_plugin_sap_response(struct custom_data *ctx, UserRequest *ur,
- struct dbus_request_info *dbus_info, enum tcore_response_command command,
- unsigned int data_len, const void *data)
-{
- const struct tresp_sap_req_connect *sap_conn = data;
- const struct tresp_sap_req_disconnect *sap_disconn = data;
- const struct tresp_sap_req_status *sap_status = data;
- const struct tresp_sap_req_atr *sap_atr = data;
- const struct tresp_sap_transfer_apdu *sap_apdu = data;
- const struct tresp_sap_set_protocol *sap_protocol = data;
- const struct tresp_sap_set_power *sap_power = data;
- const struct tresp_sap_req_cardreaderstatus *sap_reader = data;
-
- dbg("application Command = [0x%x], data_len = %d",command, data_len);
-
- switch (command) {
- case TRESP_SAP_REQ_CONNECT:
- dbg("dbus comm - TRESP_SAP_REQ_CONNECT");
- telephony_sap_complete_connect(dbus_info->interface_object, dbus_info->invocation,
- sap_conn->status, sap_conn->max_msg_size);
- break;
-
- case TRESP_SAP_REQ_DISCONNECT:
- dbg("dbus comm - TRESP_SAP_REQ_DISCONNECT");
- telephony_sap_complete_disconnect(dbus_info->interface_object, dbus_info->invocation,
- sap_disconn->result);
- break;
-
- case TRESP_SAP_REQ_STATUS:
- dbg("dbus comm - TRESP_SAP_REQ_STATUS");
- telephony_sap_complete_get_status(dbus_info->interface_object, dbus_info->invocation,
- sap_status->status);
- break;
-
- case TRESP_SAP_REQ_ATR: {
- GVariantBuilder builder;
- GVariant * atr_gv = NULL;
- GVariant *inner_gv = NULL;
- int i =0;
-
- dbg("dbus comm - TRESP_SAP_REQ_ATR");
- g_variant_builder_init(&builder, G_VARIANT_TYPE ("ay"));
- for(i = 0; i < (int)sap_atr->atr_length; i++) {
- dbg("sap_atr->atr[%d][0x%02x]", i,sap_atr->atr[i]);
- g_variant_builder_add (&builder, "y", sap_atr->atr[i]);
- }
- inner_gv = g_variant_builder_end(&builder);
- atr_gv = g_variant_new("v", inner_gv);
-
- telephony_sap_complete_get_atr(dbus_info->interface_object, dbus_info->invocation,
- sap_atr->result, atr_gv);
- }
- break;
-
- case TRESP_SAP_TRANSFER_APDU: {
- GVariantBuilder builder;
- GVariant * apdu_gv = NULL;
- GVariant *inner_gv = NULL;
- int i =0;
-
- dbg("dbus comm - TRESP_SAP_TRANSFER_APDU");
- g_variant_builder_init(&builder, G_VARIANT_TYPE ("ay"));
- for(i = 0; i < (int)sap_apdu->resp_apdu_length; i++) {
- dbg("sap_apdu->resp_adpdu[%d][0x%02x]", i,sap_apdu->resp_adpdu[i]);
- g_variant_builder_add (&builder, "y", sap_apdu->resp_adpdu[i]);
- }
- inner_gv = g_variant_builder_end(&builder);
- apdu_gv = g_variant_new("v", inner_gv);
-
- telephony_sap_complete_transfer_apdu(dbus_info->interface_object, dbus_info->invocation,
- sap_apdu->result, apdu_gv);
- }
- break;
-
- case TRESP_SAP_SET_PROTOCOL:
- dbg("dbus comm - TRESP_SAP_SET_PROTOCOL");
- telephony_sap_complete_set_protocol(dbus_info->interface_object, dbus_info->invocation,
- sap_protocol->result);
- break;
-
- case TRESP_SAP_SET_POWER:
- dbg("dbus comm - TRESP_SAP_SET_POWER");
- telephony_sap_complete_set_power(dbus_info->interface_object, dbus_info->invocation,
- sap_power->result);
- break;
-
- case TRESP_SAP_REQ_CARDREADERSTATUS:
- dbg("dbus comm - TRESP_SAP_REQ_CARDREADERSTATUS");
- telephony_sap_complete_get_card_reader_status(dbus_info->interface_object, dbus_info->invocation,
- sap_reader->result, sap_reader->reader_status);
- break;
-
- default:
- dbg("not handled command[%d]", command);
- break;
- }
-
- return TRUE;
-}
-
-gboolean dbus_plugin_sap_notification(struct custom_data *ctx, CoreObject *source,
- TelephonyObjectSkeleton *object, enum tcore_notification_command command,
- unsigned int data_len, const void *data)
-{
- TelephonySap *sap;
- const struct tnoti_sap_status_changed *n_sap_status = data;
- const struct tnoti_sap_disconnect *n_sap_disconn = data;
-
- if (!object) {
- dbg("object is NULL");
- return FALSE;
- }
-
- sap = telephony_object_peek_sap(TELEPHONY_OBJECT(object));
-
- switch (command) {
- case TNOTI_SAP_STATUS:
- dbg("notified sap_status[%d]", n_sap_status->status);
- telephony_sap_emit_status(sap, n_sap_status->status);
- break;
- case TNOTI_SAP_DISCONNECT:
- dbg("notified sap_disconnect type[%d]", n_sap_disconn->type);
- telephony_sap_emit_disconnect(sap, n_sap_disconn->type);
- break;
- default:
- dbg("not handled command[%d]", command);
- break;
- }
-
- return TRUE;
-}
+++ /dev/null
-/*
- * tel-plugin-dbus
- *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
-
-#include <tcore.h>
-#include <server.h>
-#include <plugin.h>
-#include <hal.h>
-#include <communicator.h>
-#include <core_object.h>
-#include <queue.h>
-#include <user_request.h>
-#include <util.h>
-#include <co_sat.h>
-
-#include "generated-code.h"
-#include "common.h"
-#include "sat_manager.h"
-#include "sat_ui_support/sat_ui_support.h"
-#include "package-manager.h"
-
-static void _sat_set_main_menu(struct custom_data *ctx, const char *cp_name, GVariant *main_menu)
-{
- GSList *list = NULL;
- struct cached_data *object = NULL;
-
- for (list = ctx->cached_data; list; list = list->next) {
- object = (struct cached_data *) list->data;
- if (object == NULL)
- continue;
-
- if (g_strcmp0(object->cp_name, cp_name) == 0 ) {
- /* need to free the previous main_menu */
- g_variant_unref(object->cached_sat_main_menu);
- object->cached_sat_main_menu = main_menu;
- return;
- }
- }
-
- /* If 'object' is NOT created, then create the object and add to the list */
- object = g_try_malloc0(sizeof(struct cached_data));
- if (NULL == object) {
- err(" Malloc Failed");
- return;
- }
- object->cp_name = g_strdup(cp_name);
- object->cached_sat_main_menu = main_menu;
-
- ctx->cached_data = g_slist_append(ctx->cached_data, (gpointer) object);
-}
-
-static GVariant *_sat_get_main_menu(struct custom_data *ctx, const char *cp_name)
-{
- GSList *list = NULL;
- struct cached_data *object;
-
- /*
- * List of Objects in 'ctx',
- * compare cp_name with modem_name stored in 'ctx'
- * if matching return main_menu of that object.
- */
- for (list = ctx->cached_data; list; list = list->next) {
- object = (struct cached_data *)list->data;
- if (object == NULL)
- continue;
-
- if (g_strcmp0(object->cp_name, cp_name) == 0)
- return object->cached_sat_main_menu;
- }
-
- return NULL;
-}
-
-static gboolean on_sat_get_main_menu_info(TelephonySAT *sat, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- GVariant *main_menu = NULL;
-
- gchar *title;
- gint result = 1, command_id, item_cnt;
- gboolean b_present, b_help_info, b_updated;
- GVariant *items;
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- GVariant *icon_id = NULL;
- GVariant *icon_list = NULL;
-#endif
- if (!check_access_control (invocation, AC_SAT, "r"))
- return TRUE;
-
- main_menu = _sat_get_main_menu(ctx, GET_CP_NAME(invocation));
- if(!main_menu){
- dbg("no main menu");
- return FALSE;
- }
-
-
-
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- g_variant_get(main_menu, "(ibs@vibb@v@v)", &command_id, &b_present, &title, &items, &item_cnt,
- &b_help_info, &b_updated, &icon_id, &icon_list);
-
- telephony_sat_complete_get_main_menu_info(sat, invocation, result, command_id, b_present, title,
- items, item_cnt, b_help_info, b_updated, icon_id, icon_list);
-#else
- g_variant_get(main_menu, "(ibs@vibb)", &command_id, &b_present, &title, &items, &item_cnt,
- &b_help_info, &b_updated);
-
- telephony_sat_complete_get_main_menu_info(sat, invocation, result, command_id, b_present, title,
- items, item_cnt, b_help_info, b_updated);
-#endif
- g_free(title);
-
- return TRUE;
-}
-
-static gboolean on_sat_send_display_status(TelephonySAT *sat, GDBusMethodInvocation *invocation,
- gint arg_command_id, gboolean arg_display_status,
- gpointer user_data)
-{
- TcorePlugin *plg = NULL;
- char *cp_name;
- struct custom_data *ctx = user_data;
- gboolean result = FALSE;
- gint out_param = 1;
-
- if (!check_access_control (invocation, AC_SAT, "x"))
- return TRUE;
-
- cp_name = GET_CP_NAME(invocation);
- plg = tcore_server_find_plugin(ctx->server, cp_name);
- if (!plg){
- dbg("there is no valid plugin at this point");
- out_param = 0;
- telephony_sat_complete_send_ui_display_status(sat, invocation, out_param);
- return TRUE;
- }
-
- result = sat_manager_handle_ui_display_status(ctx, plg, arg_command_id, arg_display_status);
- if(!result){
- dbg("fail to send exec result");
- }
-
- out_param = (result ? 1 : 0);
- telephony_sat_complete_send_ui_display_status(sat, invocation, out_param);
- return TRUE;
-}
-
-static gboolean on_sat_send_user_confirm(TelephonySAT *sat, GDBusMethodInvocation *invocation,
- gint arg_command_id, gint arg_command_type, gint arg_user_confirm_type,
- GVariant *arg_additional_data, gpointer user_data)
-{
- TcorePlugin *plg = NULL;
- char *cp_name;
- struct custom_data *ctx = user_data;
-
- gboolean result = FALSE;
- gint out_param = 1;
- GVariant *confirm_data = NULL;
-
- if (!check_access_control (invocation, AC_SAT, "x"))
- return TRUE;
-
- cp_name = GET_CP_NAME(invocation);
- plg = tcore_server_find_plugin(ctx->server, cp_name);
- if (!plg){
- dbg("there is no valid plugin at this point");
- out_param = 0;
- telephony_sat_complete_send_user_confirm(sat, invocation, out_param);
- return TRUE;
- }
-
- confirm_data = g_variant_new("(iiv)", arg_command_id, arg_user_confirm_type, arg_additional_data);
-
- result = sat_manager_handle_user_confirm(ctx, plg, confirm_data);
- if(!result){
- dbg("fail to send user confirm");
- }
-
- out_param = (result ? 1 : 0);
- telephony_sat_complete_send_user_confirm(sat, invocation, out_param);
-
- return TRUE;
-}
-
-static gboolean on_sat_send_app_exec_result(TelephonySAT *sat, GDBusMethodInvocation *invocation,
- gint arg_command_id, gint arg_command_type, GVariant *arg_exec_result,
- gpointer user_data)
-{
- TcorePlugin *plg = NULL;
- char *cp_name;
- struct custom_data *ctx = user_data;
-
- gboolean result = FALSE;
- gint out_param = 1;
-
- if (!check_access_control (invocation, AC_SAT, "x"))
- return TRUE;
-
- cp_name = GET_CP_NAME(invocation);
- plg = tcore_server_find_plugin(ctx->server, cp_name);
- if (!plg){
- dbg("there is no valid plugin at this point");
- out_param = 0;
- telephony_sat_complete_send_app_exec_result(sat, invocation, out_param);
- return TRUE;
- }
-
- dbg("processing app exec result");
- result = sat_manager_handle_app_exec_result(ctx, plg, arg_command_id, arg_command_type, arg_exec_result);
- if(!result){
- dbg("fail to send exec result");
- }
-
- out_param = (result ? 1 : 0);
- telephony_sat_complete_send_app_exec_result(sat, invocation, out_param);
- return TRUE;
-}
-
-static gboolean on_sat_select_menu(TelephonySAT *sat, GDBusMethodInvocation *invocation,
- guchar arg_item_identifier, gboolean arg_help_request,
- gpointer user_data)
-{
- TReturn rv;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- struct treq_sat_envelop_cmd_data envelop_data;
-
- if (!check_access_control (invocation, AC_SAT, "x"))
- return TRUE;
-
- ur = MAKE_UR(ctx, sat, invocation);
- memset(&envelop_data, 0, sizeof(struct treq_sat_envelop_cmd_data));
- envelop_data.sub_cmd = ENVELOP_MENU_SELECTION;
- envelop_data.envelop_data.menu_select.device_identitie.src = DEVICE_ID_KEYPAD;
- envelop_data.envelop_data.menu_select.device_identitie.dest = DEVICE_ID_SIM;
- envelop_data.envelop_data.menu_select.item_identifier.item_identifier = arg_item_identifier;
- envelop_data.envelop_data.menu_select.help_request = arg_help_request;
-
- tcore_user_request_set_data(ur, sizeof(struct treq_sat_envelop_cmd_data), &envelop_data);
- tcore_user_request_set_command(ur, TREQ_SAT_REQ_ENVELOPE);
- rv = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(rv != TCORE_RETURN_SUCCESS){
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", rv);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sat_download_event(TelephonySAT *sat, GDBusMethodInvocation *invocation,
- gint arg_event_download_type, gint arg_src_device,gint arg_dest_device,
- GVariant *arg_download_data, gpointer user_data)
-{
- gboolean b_event = FALSE;
- TReturn rv;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- struct treq_sat_envelop_cmd_data envelop_data;
-
- if (!check_access_control (invocation, AC_SAT, "x"))
- return TRUE;
-
- ur = MAKE_UR(ctx, sat, invocation);
- memset(&envelop_data, 0, sizeof(struct treq_sat_envelop_cmd_data));
- envelop_data.sub_cmd = ENVELOP_EVENT_DOWNLOAD;
- envelop_data.envelop_data.event_download.event = arg_event_download_type;
- b_event = sat_manager_handle_event_download_envelop(arg_event_download_type, arg_src_device, arg_dest_device,
- &envelop_data.envelop_data.event_download, arg_download_data);
-
- if(!b_event){
- telephony_sat_complete_download_event(sat, invocation, -1, ENVELOPE_FAILED);
- tcore_user_request_unref(ur);
- return TRUE;
- }
-
- tcore_user_request_set_data(ur, sizeof(struct treq_sat_envelop_cmd_data), &envelop_data);
- tcore_user_request_set_command(ur, TREQ_SAT_REQ_ENVELOPE);
- rv = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(rv != TCORE_RETURN_SUCCESS){
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", rv);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-gboolean dbus_plugin_setup_sat_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx)
-{
- TelephonySAT *sat;
-
- sat = telephony_sat_skeleton_new();
- telephony_object_skeleton_set_sat(object, sat);
- g_object_unref(sat);
-
- dbg("sat = %p", sat);
-
- g_signal_connect (sat,
- "handle-get-main-menu-info",
- G_CALLBACK (on_sat_get_main_menu_info),
- ctx);
-
- g_signal_connect (sat,
- "handle-send-ui-display-status",
- G_CALLBACK (on_sat_send_display_status),
- ctx);
-
- g_signal_connect (sat,
- "handle-send-user-confirm",
- G_CALLBACK (on_sat_send_user_confirm),
- ctx);
-
- g_signal_connect (sat,
- "handle-send-app-exec-result",
- G_CALLBACK (on_sat_send_app_exec_result),
- ctx);
-
- g_signal_connect (sat,
- "handle-select-menu",
- G_CALLBACK (on_sat_select_menu),
- ctx);
-
- g_signal_connect (sat,
- "handle-download-event",
- G_CALLBACK (on_sat_download_event),
- ctx);
-
- return TRUE;
-}
-
-gboolean dbus_plugin_sat_response(struct custom_data *ctx, UserRequest *ur,
- struct dbus_request_info *dbus_info, enum tcore_response_command command,
- unsigned int data_len, const void *data)
-{
- const struct tresp_sat_envelop_data *envelop_rsp = NULL;
-
- dbg("sat response command = [0x%x], data_len = %d", command, data_len);
-
- switch (command) {
- case TRESP_SAT_REQ_ENVELOPE: {
- envelop_rsp = (struct tresp_sat_envelop_data *)data;
-
- dbg("envelop sub_cmd(%d) result(%d) rsp(%d)", envelop_rsp->sub_cmd, envelop_rsp->result, envelop_rsp->envelop_resp);
-
- if(envelop_rsp->sub_cmd == ENVELOP_MENU_SELECTION){
- telephony_sat_complete_select_menu(dbus_info->interface_object, dbus_info->invocation,
- envelop_rsp->result, envelop_rsp->envelop_resp);
- }
- else if(envelop_rsp->sub_cmd == ENVELOP_EVENT_DOWNLOAD){
- telephony_sat_complete_download_event(dbus_info->interface_object, dbus_info->invocation,
- envelop_rsp->result, envelop_rsp->envelop_resp);
- }
- } break;
-
- case TRESP_SAT_REQ_TERMINALRESPONSE:
- dbg("receive TRESP_SAT_REQ_TERMINALRESPONSE");
- break;
-
- default:
- dbg("not handled command[%d]", command);
- break;
- }
- return TRUE;
-}
-
-gboolean dbus_plugin_sat_notification(struct custom_data *ctx, CoreObject *source,
- TelephonyObjectSkeleton *object, enum tcore_notification_command command,
- unsigned int data_len, const void *data)
-{
- TelephonySAT *sat;
- const char *cp_name;
- enum dbus_tapi_sim_slot_id slot_id;
-
- if (!object || !ctx) {
- dbg("NULL data is detected!!");
- return FALSE;
- }
- cp_name = tcore_server_get_cp_name_by_plugin(tcore_object_ref_plugin(source));
-
- slot_id = get_sim_slot_id_by_cp_name((char *)cp_name);
- dbg("slot_id: [%d]", slot_id);
-
- sat = telephony_object_peek_sat(TELEPHONY_OBJECT(object));
-
- //session end notification
- switch (command) {
- case TNOTI_SAT_SESSION_END: {
-
- dbg("notified sat session end evt");
- sat_manager_init_queue(ctx, cp_name);
-
- //sat_ui_support_terminate_sat_ui();
- telephony_sat_emit_end_proactive_session(sat, SAT_PROATV_CMD_TYPE_END_PROACTIVE_SESSION);
- return TRUE;
- }
- break;
-
- //call control notification
- case TNOTI_SAT_CALL_CTRL_RESULT: {
- struct tnoti_sat_call_control_result_ind *cc_result_noti = NULL;
- gint call_ctrl_result = 0, bc_repeat_indicator = 0, ton = 0x0F, npi=0X0F;
- gchar *text = NULL, *call_num = NULL, *ss_string = NULL, *sub_addr = NULL, *ccp1 = NULL, *ccp2 = NULL;
-
- cc_result_noti = (struct tnoti_sat_call_control_result_ind *)data;
- if (cc_result_noti == NULL) {
- err("Indication data is NULL");
- return FALSE;
- }
- dbg("sat call control result notification");
-
- call_ctrl_result = cc_result_noti->cc_result;
- bc_repeat_indicator = cc_result_noti->bc_repeat_type.bc_indi_repeat_type;
-
- if(cc_result_noti->address.dialing_number_len > 0){
- ton = cc_result_noti->address.ton;
- npi = cc_result_noti->address.npi;
- if(ton == TON_INTERNATIONAL)
- call_num = g_strdup_printf("+%s", cc_result_noti->address.dialing_number);
- else
- call_num = g_strdup(cc_result_noti->address.dialing_number);
- ss_string = g_strdup("");
- }
- else if(cc_result_noti->ss_string.string_len > 0){
- ton = cc_result_noti->ss_string.ton;
- npi = cc_result_noti->ss_string.npi;
- call_num = g_strdup("");
- ss_string = g_strdup(cc_result_noti->ss_string.ss_string);
- }
-
- if(cc_result_noti->alpha_id.alpha_data_len > 0){
- text = g_strdup(cc_result_noti->alpha_id.alpha_data);
- }
- else{
- text = g_strdup("");
- }
-
- if(cc_result_noti->sub_address.subaddress_len > 0){
- sub_addr = g_strdup(cc_result_noti->sub_address.subaddress);
- }
- else{
- sub_addr = g_strdup("");
- }
-
- if(cc_result_noti->ccp1.data_len > 0){
- ccp1 = g_strdup(cc_result_noti->ccp1.data);
- }
- else{
- ccp1 = g_strdup("");
- }
-
-
- if(cc_result_noti->ccp2.data_len > 0){
- ccp2 = g_strdup(cc_result_noti->ccp2.data);
- }
- else{
- ccp2 = g_strdup("");
- }
-
- telephony_sat_emit_call_control_result(sat, call_ctrl_result, text, ton, npi, call_num,
- ss_string, sub_addr, ccp1, ccp2, bc_repeat_indicator);
-
- g_free(text); g_free(call_num); g_free(ss_string); g_free(sub_addr); g_free(ccp1); g_free(ccp2);
- return TRUE;
- }
- break;
-
- case TNOTI_SAT_MO_SM_CTRL_RESULT: {
- struct tnoti_sat_mo_sm_control_result_ind *mo_sm_result_noti = NULL;
- gint call_ctrl_result = 0;
- gint rp_dst_ton = 0x0F, rp_dst_npi = 0X0F, tp_dst_ton = 0x0F, tp_dst_npi = 0X0F;
- gchar *text = NULL, *rp_dst_call_num = NULL, *tp_dst_call_num = NULL;
-
- mo_sm_result_noti = (struct tnoti_sat_mo_sm_control_result_ind *)data;
- if (mo_sm_result_noti == NULL) {
- err("Indication data is NULL");
- return FALSE;
- }
- dbg("sat mo sm control result notification");
-
- call_ctrl_result = mo_sm_result_noti->cc_result;
-
- if(mo_sm_result_noti->rp_dst_address.dialing_number_len > 0){
- rp_dst_ton = mo_sm_result_noti->rp_dst_address.ton;
- rp_dst_npi = mo_sm_result_noti->rp_dst_address.npi;
- if(rp_dst_ton == TON_INTERNATIONAL)
- rp_dst_call_num = g_strdup_printf("+%s", mo_sm_result_noti->rp_dst_address.dialing_number);
- else
- rp_dst_call_num = g_strdup(mo_sm_result_noti->rp_dst_address.dialing_number);
- } else {
- rp_dst_call_num = g_strdup("");
- }
-
- if(mo_sm_result_noti->tp_dst_address.dialing_number_len > 0){
- tp_dst_ton = mo_sm_result_noti->tp_dst_address.ton;
- tp_dst_npi = mo_sm_result_noti->tp_dst_address.npi;
- if(tp_dst_ton == TON_INTERNATIONAL)
- tp_dst_call_num = g_strdup_printf("+%s", mo_sm_result_noti->tp_dst_address.dialing_number);
- else
- tp_dst_call_num = g_strdup(mo_sm_result_noti->tp_dst_address.dialing_number);
- } else {
- tp_dst_call_num = g_strdup("");
- }
-
- if(mo_sm_result_noti->alpha_id.alpha_data_len > 0){
- text = g_strdup(mo_sm_result_noti->alpha_id.alpha_data);
- }
- else{
- text = g_strdup("");
- }
-
- telephony_sat_emit_mo_sm_control_result(sat, call_ctrl_result, text,
- rp_dst_ton, rp_dst_npi, rp_dst_call_num, tp_dst_ton, tp_dst_npi, tp_dst_call_num);
-
- g_free(text); g_free(rp_dst_call_num); g_free(tp_dst_call_num);
- return TRUE;
- }
- break;
-
- //Proactive Command Notification
- case TNOTI_SAT_PROACTIVE_CMD: {
- struct tnoti_sat_proactive_ind *p_ind;
- TcorePlugin *plg;
- plg = tcore_object_ref_plugin(source);
- if (plg == NULL) {
- dbg("there is no valid plugin at this point");
- return FALSE;
- }
-
- if (cp_name == NULL) {
- dbg("CP name is NULL");
- return FALSE;
- }
-
- p_ind = (struct tnoti_sat_proactive_ind *)data;
- if (p_ind == NULL) {
- dbg("Indication data is NULL");
- return FALSE;
- }
- dbg("notified sat proactive command(%d)", p_ind->cmd_type);
-
- switch (p_ind->cmd_type) {
- case SAT_PROATV_CMD_SETUP_MENU:{
- GVariant *menu_info = NULL;
- gchar *title;
- gint command_id, menu_cnt;
- gboolean b_present, b_helpinfo, b_updated;
- GVariant *items;
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- GVariant *icon_id = NULL;
- GVariant *icon_list = NULL;
-#endif
- menu_info = sat_manager_caching_setup_menu_info(ctx, cp_name,
- (struct tel_sat_setup_menu_tlv*)&p_ind->proactive_ind_data.setup_menu);
-
- dbg("menu_info type_format(%s)", g_variant_get_type_string(menu_info));
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- g_variant_get(menu_info, "(ibs@vibb@v@v)", &command_id, &b_present, &title, &items,
- &menu_cnt, &b_helpinfo, &b_updated, &icon_id, &icon_list);
-#else
- g_variant_get(menu_info, "(ibs@vibb)", &command_id, &b_present, &title, &items,
- &menu_cnt, &b_helpinfo, &b_updated);
-#endif
- if(!menu_cnt){
- dbg("no main menu data");
- /* No need to cache anything so make store NULL in cached_sat_main_menu */
- _sat_set_main_menu(ctx, cp_name, NULL);
- g_variant_unref(menu_info);
- } else {
- _sat_set_main_menu(ctx, cp_name, menu_info);
- }
- if(b_updated) {
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- telephony_sat_emit_setup_menu(sat, command_id, b_present, title, items, menu_cnt,
- b_helpinfo, b_updated, icon_id, icon_list);
-#else
- telephony_sat_emit_setup_menu(sat, command_id, b_present, title, items, menu_cnt,
- b_helpinfo, b_updated);
-#endif
- }
- g_free(title);
- } break;
-
- case SAT_PROATV_CMD_DISPLAY_TEXT:{
- GVariant *display_text = NULL;
-
- gint command_id, text_len, duration;
- gboolean high_priority, user_rsp_required, immediately_rsp;
- gchar* text = NULL;
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- GVariant *icon_id = NULL;
-#endif
- int ret;
-
- display_text = sat_manager_display_text_noti(ctx, cp_name, (struct tel_sat_display_text_tlv*) &p_ind->proactive_ind_data.display_text, p_ind->decode_err_code);
-
- if(!display_text){
- dbg("no display text data");
- return TRUE;
- }
-
- dbg("display text type_format(%s)", g_variant_get_type_string(display_text));
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- g_variant_get(display_text, "(isiibbb@v)", &command_id, &text, &text_len, &duration,
- &high_priority, &user_rsp_required, &immediately_rsp, &icon_id);
-#else
- g_variant_get(display_text, "(isiibbb)", &command_id, &text, &text_len, &duration,
- &high_priority, &user_rsp_required, &immediately_rsp);
-#endif
- ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_DISPLAY_TEXT, display_text, slot_id);
- if(!ret) {
- int rv;
- dbg("fail to launch sat-ui, remove the queued data!!\n");
- if(!sat_manager_handle_sat_ui_launch_fail(ctx, cp_name, p_ind))
- dbg("Fail to send terminal response\n");
- rv = sat_manager_remove_cmd_by_id(ctx, command_id);
- if(!rv)
- dbg("fail to dequeue data\n");
- }
-
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- telephony_sat_emit_display_text(sat, command_id, text, text_len, duration,
- high_priority, user_rsp_required, immediately_rsp, icon_id);
-#else
- telephony_sat_emit_display_text(sat, command_id, text, text_len, duration,
- high_priority, user_rsp_required, immediately_rsp);
-#endif
- g_free(text);
- } break;
-
- case SAT_PROATV_CMD_SELECT_ITEM:{
- GVariant *select_menu = NULL;
-
- gboolean help_info ;
- gchar *selected_text = NULL;
- gint command_id, default_item_id, menu_cnt, text_len =0;
- GVariant *menu_items;
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- GVariant *icon_id, *icon_list;
-#endif
- int ret;
-
- select_menu = sat_manager_select_item_noti(ctx, cp_name, (struct tel_sat_select_item_tlv*) &p_ind->proactive_ind_data.select_item);
-
- if(!select_menu){
- dbg("no select menu data");
- return TRUE;
- }
-
- dbg("select menu type_format(%s)", g_variant_get_type_string(select_menu));
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- g_variant_get(select_menu, "(ibsiii@v@v@v)", &command_id, &help_info, &selected_text,
- &text_len, &default_item_id, &menu_cnt, &menu_items, &icon_id, &icon_list);
-#else
- g_variant_get(select_menu, "(ibsiii@v)", &command_id, &help_info, &selected_text,
- &text_len, &default_item_id, &menu_cnt, &menu_items);
-#endif
- ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_SELECT_ITEM, select_menu, slot_id);
- if(!ret) {
- int rv;
- dbg("fail to launch sat-ui, remove the queued data!!\n");
- if(!sat_manager_handle_sat_ui_launch_fail(ctx, cp_name, p_ind))
- dbg("Fail to send terminal response\n");
- rv = sat_manager_remove_cmd_by_id(ctx, command_id);
- if(!rv)
- dbg("fail to dequeue data\n");
- }
-
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- telephony_sat_emit_select_item (sat, command_id, help_info, selected_text, text_len,
- default_item_id, menu_cnt, menu_items, icon_id, icon_list);
-#else
- telephony_sat_emit_select_item (sat, command_id, help_info, selected_text, text_len,
- default_item_id, menu_cnt, menu_items);
-#endif
- g_free(selected_text);
- } break;
-
- case SAT_PROATV_CMD_GET_INKEY:{
- GVariant *get_inkey = NULL;
- gint command_id, key_type, input_character_mode;
- gint text_len, duration;
- gboolean b_numeric, b_help_info;
- gchar *text = NULL;
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- GVariant *icon_id;
-#endif
- int ret;
-
- get_inkey = sat_manager_get_inkey_noti(ctx, cp_name, (struct tel_sat_get_inkey_tlv*) &p_ind->proactive_ind_data.get_inkey, p_ind->decode_err_code);
-
- if(!get_inkey){
- dbg("no get inkey data");
- return TRUE;
- }
-
- dbg("get inkey type_format(%s)", g_variant_get_type_string(get_inkey));
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- g_variant_get(get_inkey, "(iiibbsii@v)", &command_id, &key_type, &input_character_mode,
- &b_numeric,&b_help_info, &text, &text_len, &duration, &icon_id);
-#else
- g_variant_get(get_inkey, "(iiibbsii)", &command_id, &key_type, &input_character_mode,
- &b_numeric,&b_help_info, &text, &text_len, &duration);
-#endif
- ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_GET_INKEY, get_inkey, slot_id);
- if(!ret) {
- int rv;
- dbg("fail to launch sat-ui, remove the queued data!!\n");
- if(!sat_manager_handle_sat_ui_launch_fail(ctx, cp_name, p_ind))
- dbg("Fail to send terminal response\n");
- rv = sat_manager_remove_cmd_by_id(ctx, command_id);
- if(!rv)
- dbg("fail to dequeue data\n");
- }
-
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- telephony_sat_emit_get_inkey(sat, command_id, key_type, input_character_mode,
- b_numeric, b_help_info, text, text_len, duration, icon_id);
-#else
- telephony_sat_emit_get_inkey(sat, command_id, key_type, input_character_mode,
- b_numeric, b_help_info, text, text_len, duration);
-#endif
- g_free(text);
- } break;
-
- case SAT_PROATV_CMD_GET_INPUT:{
- GVariant *get_input = NULL;
- gint command_id, input_character_mode;
- gint text_len, def_text_len, rsp_len_min, rsp_len_max;
- gboolean b_numeric, b_help_info, b_echo_input;
- gchar *text = NULL, *def_text = NULL;
- int ret;
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- GVariant *icon_id;
-#endif
- get_input = sat_manager_get_input_noti(ctx, cp_name, (struct tel_sat_get_input_tlv*) &p_ind->proactive_ind_data.get_input, p_ind->decode_err_code);
-
- if(!get_input){
- dbg("no get input data");
- return TRUE;
- }
-
- dbg("get input type_format(%s)", g_variant_get_type_string(get_input));
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- g_variant_get(get_input, "(iibbbsiiisi@v)", &command_id, &input_character_mode, &b_numeric, &b_help_info, &b_echo_input,
- &text, &text_len, &rsp_len_max, &rsp_len_min, &def_text, &def_text_len, &icon_id);
-#else
- g_variant_get(get_input, "(iibbbsiiisi)", &command_id, &input_character_mode, &b_numeric, &b_help_info, &b_echo_input,
- &text, &text_len, &rsp_len_max, &rsp_len_min, &def_text, &def_text_len);
-#endif
- ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_GET_INPUT, get_input, slot_id);
- if(!ret) {
- int rv;
- dbg("fail to launch sat-ui, remove the queued data!!\n");
- if(!sat_manager_handle_sat_ui_launch_fail(ctx, cp_name, p_ind))
- dbg("Fail to send terminal response\n");
- rv = sat_manager_remove_cmd_by_id(ctx, command_id);
- if(!rv)
- dbg("fail to dequeue data\n");
- }
-
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- telephony_sat_emit_get_input(sat, command_id, input_character_mode, b_numeric, b_help_info,
- b_echo_input, text, text_len, rsp_len_max, rsp_len_min, def_text, def_text_len, icon_id);
-#else
- telephony_sat_emit_get_input(sat, command_id, input_character_mode, b_numeric, b_help_info,
- b_echo_input, text, text_len, rsp_len_max, rsp_len_min, def_text, def_text_len);
-#endif
- g_free(text);
- g_free(def_text);
- } break;
-
- case SAT_PROATV_CMD_PLAY_TONE:{
- GVariant *play_tone = NULL;
- gint command_id, tone_type, duration;
- gint text_len;
- gchar* text = NULL;
- int ret;
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- GVariant *icon_id;
-#endif
- play_tone = sat_manager_play_tone_noti(ctx, cp_name, (struct tel_sat_play_tone_tlv*) &p_ind->proactive_ind_data.play_tone);
-
- if(!play_tone){
- dbg("no play tone data");
- return TRUE;
- }
-
- dbg("play tone type_format(%s)", g_variant_get_type_string(play_tone));
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- g_variant_get(play_tone, "(isi@vii)", &command_id, &text, &text_len, &icon_id, &tone_type, &duration);
-#else
- g_variant_get(play_tone, "(isiii)", &command_id, &text, &text_len, &tone_type, &duration);
-#endif
- ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_PLAY_TONE, play_tone, slot_id);
- if(!ret) {
- int rv;
- dbg("fail to launch sat-ui, remove the queued data!!\n");
- if(!sat_manager_handle_sat_ui_launch_fail(ctx, cp_name, p_ind))
- dbg("Fail to send terminal response\n");
- rv = sat_manager_remove_cmd_by_id(ctx, command_id);
- if(!rv)
- dbg("fail to dequeue data\n");
- }
-
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- telephony_sat_emit_play_tone(sat, command_id, text, text_len, icon_id, tone_type, duration);
-#else
- telephony_sat_emit_play_tone(sat, command_id, text, text_len, tone_type, duration);
-#endif
- g_free(text);
- } break;
-
- case SAT_PROATV_CMD_SEND_SMS:{
- GVariant *send_sms = NULL;
-
- gint command_id, ton, npi, tpdu_type;
- gboolean b_packing_required;
- gint text_len, number_len, tpdu_data_len;
- gchar* text = NULL, *dialling_number = NULL;
- GVariant *tpdu_data;
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- GVariant *icon_id;
-#endif
- send_sms = sat_manager_send_sms_noti(ctx, cp_name, (struct tel_sat_send_sms_tlv*) &p_ind->proactive_ind_data.send_sms);
-
- if(!send_sms){
- dbg("no send sms data");
- return TRUE;
- }
-
- dbg("send sms type_format(%s)", g_variant_get_type_string(send_sms));
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- g_variant_get(send_sms, "(isi@vbiisii@vi)", &command_id, &text, &text_len, &icon_id, &b_packing_required, &ton, &npi,
- &dialling_number, &number_len, &tpdu_type, &tpdu_data, &tpdu_data_len);
-#else
- g_variant_get(send_sms, "(isibiisii@vi)", &command_id, &text, &text_len, &b_packing_required, &ton, &npi,
- &dialling_number, &number_len, &tpdu_type, &tpdu_data, &tpdu_data_len);
-#endif
- dbg("check display text : text(%s) text len(%d)", text, text_len);
- if(text_len > 1 && (g_strcmp0(text,"") != 0) ){
- GVariant *ui_info = NULL;
- gboolean user_confirm = FALSE;
- int ret;
- dbg("text should be displayed by ui");
- dbg("send sms is pending!!!");
-
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- ui_info = g_variant_new("(isibv)", command_id, text, text_len, user_confirm, icon_id);
-#else
- ui_info = g_variant_new("(isib)", command_id, text, text_len, user_confirm);
-#endif
- ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_SEND_SMS, ui_info, slot_id);
- if(!ret) {
- int rv;
- dbg("fail to launch sat-ui, remove the queued data!!\n");
- if(!sat_manager_handle_sat_ui_launch_fail(ctx, cp_name, p_ind))
- dbg("Fail to send terminal response\n");
- rv = sat_manager_remove_cmd_by_id(ctx, command_id);
- if(!rv)
- dbg("fail to dequeue data\n");
- }
- g_free(text);
- g_free(dialling_number);
- return TRUE;
- }
-#if !defined(TIZEN_PLATFORM_USE_QCOM_QMI)
- telephony_sat_emit_send_sms(sat, command_id, text, text_len, b_packing_required,
- ton, npi, dialling_number, number_len, tpdu_type, tpdu_data, tpdu_data_len);
-#endif
- g_free(text);
- g_free(dialling_number);
- } break;
-
- case SAT_PROATV_CMD_SEND_SS:{
- GVariant *send_ss = NULL;
-
- gint command_id, ton, npi;
- gint text_len, ss_str_len;
- gchar* text = NULL, *ss_string = NULL;
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- GVariant *icon_id;
-#endif
- send_ss = sat_manager_send_ss_noti(ctx, cp_name, (struct tel_sat_send_ss_tlv*) &p_ind->proactive_ind_data.send_ss);
-
- if(!send_ss){
- dbg("no send ss data");
- return TRUE;
- }
-
- dbg("send ss type_format(%s)", g_variant_get_type_string(send_ss));
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- g_variant_get(send_ss, "(isi@viiis)", &command_id, &text, &text_len, &icon_id,
- &ton, &npi, &ss_str_len, &ss_string);
-#else
- g_variant_get(send_ss, "(isiiiis)", &command_id, &text, &text_len,
- &ton, &npi, &ss_str_len, &ss_string);
-#endif
- dbg("check display text : text(%s) text len(%d)", text, text_len);
- if(text_len > 1 && (g_strcmp0(text,"") != 0) ){
- GVariant *ui_info = NULL;
- gboolean user_confirm = FALSE;
- int ret;
- dbg("text should be displayed by ui");
- dbg("send ss is pending!!!");
-
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- ui_info = g_variant_new("(isibv)", command_id, text, text_len, user_confirm, icon_id);
-#else
- ui_info = g_variant_new("(isib)", command_id, text, text_len, user_confirm);
-#endif
- ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_NONE, ui_info, slot_id);
- if(!ret) {
- int rv;
- dbg("fail to launch sat-ui, remove the queued data!!\n");
- if(!sat_manager_handle_sat_ui_launch_fail(ctx, cp_name, p_ind))
- dbg("Fail to send terminal response\n");
- rv = sat_manager_remove_cmd_by_id(ctx, command_id);
- if(!rv)
- dbg("fail to dequeue data\n");
- }
- g_free(text);
- g_free(ss_string);
- return TRUE;
- }
-#if !defined(TIZEN_PLATFORM_USE_QCOM_QMI)
- telephony_sat_emit_send_ss(sat, command_id, text, text_len, ton, npi, ss_string);
- //tizen ciss
- sat_ui_support_launch_ciss_application(SAT_PROATV_CMD_SEND_SS, send_ss, slot_id);
-#endif
- g_free(text);
- g_free(ss_string);
- } break;
-
- case SAT_PROATV_CMD_SEND_USSD:{
- GVariant *send_ussd = NULL;
-
- gint command_id;
- gint text_len, ussd_str_len;
- guchar dcs;
- gchar* text = NULL, *ussd_string = NULL;
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- GVariant *icon_id;
-#endif
- send_ussd = sat_manager_send_ussd_noti(ctx, cp_name, (struct tel_sat_send_ussd_tlv*) &p_ind->proactive_ind_data.send_ussd);
-
- if(!send_ussd){
- dbg("no send ussd data");
- return TRUE;
- }
-
- dbg("send ussd type_format(%s)", g_variant_get_type_string(send_ussd));
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- g_variant_get(send_ussd, "(isi@vyis)", &command_id, &text, &text_len, &icon_id, &dcs, &ussd_str_len, &ussd_string);
-#else
- g_variant_get(send_ussd, "(isiyis)", &command_id, &text, &text_len, &dcs, &ussd_str_len, &ussd_string);
-#endif
- dbg("check display text : text(%s) text len(%d)", text, text_len);
- if(text_len > 1 && (g_strcmp0(text,"") != 0) ){
- GVariant *ui_info = NULL;
- gboolean user_confirm = FALSE;
- int ret;
- dbg("text should be displayed by ui");
- dbg("send ussd is pending!!!");
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- ui_info = g_variant_new("(isibv)", command_id, text, text_len, user_confirm, icon_id);
-#else
- ui_info = g_variant_new("(isib)", command_id, text, text_len, user_confirm);
-#endif
- ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_NONE, ui_info, slot_id);
- if(!ret) {
- int rv;
- dbg("fail to launch sat-ui, remove the queued data!!\n");
- if(!sat_manager_handle_sat_ui_launch_fail(ctx, cp_name, p_ind))
- dbg("Fail to send terminal response\n");
- rv = sat_manager_remove_cmd_by_id(ctx, command_id);
- if(!rv)
- dbg("fail to dequeue data\n");
- }
- g_free(text);
- g_free(ussd_string);
- return TRUE;
- }
-#if !defined(TIZEN_PLATFORM_USE_QCOM_QMI)
- telephony_sat_emit_setup_ussd(sat, command_id, text, text_len, dcs, ussd_string);
- //tizen ciss ui
- sat_ui_support_launch_ciss_application(SAT_PROATV_CMD_SEND_USSD, send_ussd, slot_id);
-#endif
- g_free(text);
- g_free(ussd_string);
- } break;
-
- case SAT_PROATV_CMD_SETUP_CALL:{
- GVariant *setup_call = NULL;
-
- gint command_id, call_type, confirmed_text_len, text_len, duration;
- gchar *confirmed_text, *text = NULL, *call_number = NULL;
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- GVariant *icon_id;
-#endif
- setup_call = sat_manager_setup_call_noti(ctx, cp_name, (struct tel_sat_setup_call_tlv*) &p_ind->proactive_ind_data.setup_call);
-
- if(!setup_call){
- dbg("no setup call data");
- return TRUE;
- }
-
- dbg("setup call type_format(%s)", g_variant_get_type_string(setup_call));
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- g_variant_get(setup_call, "(isisi@visi)", &command_id, &confirmed_text, &confirmed_text_len, &text, &text_len, &icon_id, &call_type, &call_number, &duration);
-#else
- g_variant_get(setup_call, "(isisiisi)", &command_id, &confirmed_text, &confirmed_text_len, &text, &text_len, &call_type, &call_number, &duration);
-#endif
- dbg("check display text : text(%s) text len(%d)", confirmed_text, confirmed_text_len);
- if(confirmed_text_len > 1 && (g_strcmp0(confirmed_text,"") != 0) ){
- GVariant *ui_info = NULL;
- gboolean user_confirm = TRUE;
- int ret;
- dbg("text should be displayed by ui");
- dbg("setup call is pending!!!");
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- ui_info = g_variant_new("(isibv)", command_id, confirmed_text, confirmed_text_len, user_confirm, icon_id);
-#else
- ui_info = g_variant_new("(isib)", command_id, confirmed_text, confirmed_text_len, user_confirm);
-#endif
- ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_NONE, ui_info, slot_id);
- if(!ret) {
- int rv;
- dbg("fail to launch sat-ui, remove the queued data!!\n");
- if(!sat_manager_handle_sat_ui_launch_fail(ctx, cp_name, p_ind))
- dbg("Fail to send terminal response\n");
- rv = sat_manager_remove_cmd_by_id(ctx, command_id);
- if(!rv)
- dbg("fail to dequeue data\n");
- }
- g_free(text);
- g_free(call_number);
- return TRUE;
- }
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- telephony_sat_emit_setup_call(sat, command_id, confirmed_text, confirmed_text_len,text, text_len, icon_id, call_type, call_number, duration);
-#else
- telephony_sat_emit_setup_call(sat, command_id, confirmed_text, confirmed_text_len,text, text_len, call_type, call_number, duration);
-#endif
- g_free(text);
- g_free(call_number);
-
- //tizen call ui in no alpha id case
- sat_ui_support_launch_call_application(SAT_PROATV_CMD_SETUP_CALL, setup_call, slot_id);
-
- }break;
-
- case SAT_PROATV_CMD_SETUP_EVENT_LIST:{
- GVariant *event_list = NULL;
-
- gint event_cnt;
- GVariant *evt_list;
-
- event_list = sat_manager_setup_event_list_noti(ctx, cp_name, (struct tel_sat_setup_event_list_tlv*) &p_ind->proactive_ind_data.setup_event_list);
-
- if(!event_list){
- dbg("no setup event list data");
- return TRUE;
- }
-
- dbg("setup event list type_format(%s)", g_variant_get_type_string(event_list));
- g_variant_get(event_list, "(i@v)", &event_cnt, &evt_list);
-
- telephony_sat_emit_setup_event_list(sat, event_cnt, evt_list);
-
- //bip proactive command is only handled by BIP Manager
- {
- GDBusConnection *conn = NULL;
- const gchar *g_path = NULL;
-
- conn = g_dbus_object_manager_server_get_connection(ctx->manager);
- g_path = g_dbus_object_get_object_path(G_DBUS_OBJECT(object));
-
- /* TODO: SAT Event Downloader should execute event_list as well. */
- sat_ui_support_exec_evtdw(conn, g_path, SAT_PROATV_CMD_SETUP_EVENT_LIST, event_list);
- sat_ui_support_exec_bip(conn, g_path, SAT_PROATV_CMD_SETUP_EVENT_LIST, event_list);
- }
- } break;
-
- case SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT:{
- GVariant *setup_idle_mode = NULL;
- int ret;
-
- gint command_id, text_len;
- gchar* text = NULL;
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- GVariant *icon_id;
-#endif
- setup_idle_mode = sat_manager_setup_idle_mode_text_noti(ctx, cp_name, (struct tel_sat_setup_idle_mode_text_tlv*) &p_ind->proactive_ind_data.setup_idle_mode_text, p_ind->decode_err_code);
-
- if(!setup_idle_mode){
- dbg("no setup idle mode text data");
- return TRUE;
- }
-
- dbg("setup idle mode text type_format(%s)", g_variant_get_type_string(setup_idle_mode));
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- g_variant_get(setup_idle_mode, "(isi@v)", &command_id, &text, &text_len, &icon_id);
-#else
- g_variant_get(setup_idle_mode, "(isi)", &command_id, &text, &text_len);
-#endif
-
- ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT, setup_idle_mode, slot_id);
- if(!ret) {
- int rv;
- dbg("fail to launch sat-ui, remove the queued data!!\n");
- if(!sat_manager_handle_sat_ui_launch_fail(ctx, cp_name, p_ind))
- dbg("Fail to send terminal response\n");
- rv = sat_manager_remove_cmd_by_id(ctx, command_id);
- if(!rv)
- dbg("fail to dequeue data\n");
- }
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- telephony_sat_emit_setup_idle_mode_text(sat, command_id, text, text_len, icon_id);
-#else
- telephony_sat_emit_setup_idle_mode_text(sat, command_id, text, text_len);
-#endif
- g_free(text);
- } break;
-
- case SAT_PROATV_CMD_OPEN_CHANNEL:{
- GVariant *open_channel = NULL;
-
- gint command_id, bearer_type, protocol_type, dest_addr_type;
- gboolean immediate_link, auto_reconnection, bg_mode;
- gint text_len, buffer_size, port_number;
- gchar *text = NULL, *dest_address;
- GVariant *bearer_param;
- GVariant *bearer_detail;
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- GVariant *icon_id;
-#endif
- open_channel = sat_manager_open_channel_noti(ctx, cp_name, (struct tel_sat_open_channel_tlv*) &p_ind->proactive_ind_data.open_channel);
-
- if(!open_channel){
- dbg("no open channel data");
- return TRUE;
- }
-
- dbg("open channel type_format(%s)", g_variant_get_type_string(open_channel));
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- g_variant_get(open_channel,"(isi@vbbbi@viiiis@v)", &command_id, &text, &text_len, &icon_id, &immediate_link, &auto_reconnection, &bg_mode,
- &bearer_type, &bearer_param, &buffer_size, &protocol_type, &port_number, &dest_addr_type, &dest_address, &bearer_detail);
-#else
- g_variant_get(open_channel,"(isibbbi@viiiis@v)", &command_id, &text, &text_len, &immediate_link, &auto_reconnection, &bg_mode,
- &bearer_type, &bearer_param, &buffer_size, &protocol_type, &port_number, &dest_addr_type, &dest_address, &bearer_detail);
-#endif
- dbg("check display text : text(%s) text len(%d)", text, text_len);
- if(text_len > 1 && (g_strcmp0(text,"") != 0) ){
- GVariant *ui_info = NULL;
- gboolean user_confirm = TRUE;
- int ret;
- dbg("text should be displayed by ui");
- dbg("open channel text is displayed!!!");
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- ui_info = g_variant_new("(isibv)", command_id, text, text_len, user_confirm, icon_id);
-#else
- ui_info = g_variant_new("(isib)", command_id, text, text_len, user_confirm);
-#endif
- ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_NONE, ui_info, slot_id);
- if(!ret) {
- int rv;
- dbg("fail to launch sat-ui, remove the queued data!!\n");
- if(!sat_manager_handle_sat_ui_launch_fail(ctx, cp_name, p_ind))
- dbg("Fail to send terminal response\n");
- rv = sat_manager_remove_cmd_by_id(ctx, command_id);
- if(!rv)
- dbg("fail to dequeue data\n");
- }
- g_free(text);
- g_free(dest_address);
- return TRUE;
- }
- g_free(text);
- g_free(dest_address);
-
- /*telephony_sat_emit_open_channel(sat, command_id, text, text_len, immediate_link, auto_reconnection, bg_mode,
- bearer_type, bearer_param, buffer_size, protocol_type, port_number, dest_addr_type, dest_address, bearer_detail);*/
-#if !defined(TIZEN_PLATFORM_USE_QCOM_QMI)
- //bip proactive command is only handled by BIP Manager
- {
- GDBusConnection *conn = NULL;
- const gchar *g_path = NULL;
-
- conn = g_dbus_object_manager_server_get_connection(ctx->manager);
- g_path = g_dbus_object_get_object_path(G_DBUS_OBJECT(object));
-
- sat_ui_support_exec_bip(conn, g_path, SAT_PROATV_CMD_OPEN_CHANNEL, open_channel);
- }
-#endif
- } break;
-
- case SAT_PROATV_CMD_CLOSE_CHANNEL:{
- GVariant *close_channel = NULL;
-
- gint command_id, channel_id, text_len;
- gchar *text = NULL;
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- GVariant *icon_id;
-#endif
- close_channel = sat_manager_close_channel_noti(ctx, cp_name, (struct tel_sat_close_channel_tlv*) &p_ind->proactive_ind_data.close_channel);
-
- if(!close_channel){
- dbg("no close channel data");
- return TRUE;
- }
-
- //TODO check the data for sat-ui
-
- dbg("close channel type_format(%s)", g_variant_get_type_string(close_channel));
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- g_variant_get(close_channel, "(isi@vi)", &command_id, &text, &text_len, &icon_id, &channel_id);
-#else
- g_variant_get(close_channel, "(isii)", &command_id, &text, &text_len, &channel_id);
-#endif
-
- /*telephony_sat_emit_close_channel(sat, command_id, text, text_len, channel_id);*/
-
- //bip proactive command is only handled by BIP Manager
- {
- GDBusConnection *conn = NULL;
- const gchar *g_path = NULL;
-
- conn = g_dbus_object_manager_server_get_connection(ctx->manager);
- g_path = g_dbus_object_get_object_path(G_DBUS_OBJECT(object));
-
- sat_ui_support_exec_bip(conn, g_path, SAT_PROATV_CMD_CLOSE_CHANNEL, close_channel);
- }
-
- g_free(text);
- } break;
-
- case SAT_PROATV_CMD_RECEIVE_DATA:{
- GVariant *receive_data = NULL;
-
- gint command_id, text_len, channel_id, channel_data_len = 0;
- gchar *text = NULL;
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- GVariant *icon_id;
-#endif
- receive_data = sat_manager_receive_data_noti(ctx, cp_name, (struct tel_sat_receive_channel_tlv*) &p_ind->proactive_ind_data.receive_data);
-
- if(!receive_data){
- dbg("no receive data data");
- return TRUE;
- }
-
- //TODO check the data for sat-ui
-
- dbg("receive data type_format(%s)", g_variant_get_type_string(receive_data));
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- g_variant_get(receive_data, "(isi@vii)", &command_id, &text, &text_len, &icon_id, &channel_id, &channel_data_len);
-#else
- g_variant_get(receive_data, "(isiii)", &command_id, &text, &text_len, &channel_id, &channel_data_len);
-#endif
- /*telephony_sat_emit_receive_data(sat, command_id, text, text_len, channel_id, channel_data_len);*/
-
- //bip proactive command is only handled by BIP Manager
- {
- GDBusConnection *conn = NULL;
- const gchar *g_path = NULL;
-
- conn = g_dbus_object_manager_server_get_connection(ctx->manager);
- g_path = g_dbus_object_get_object_path(G_DBUS_OBJECT(object));
-
- sat_ui_support_exec_bip(conn, g_path, SAT_PROATV_CMD_RECEIVE_DATA, receive_data);
- }
- g_free(text);
- } break;
-
- case SAT_PROATV_CMD_SEND_DATA:{
- GVariant *send_data = NULL;
-
- gint command_id, channel_id, text_len, channel_data_len;
- gboolean send_data_immediately;
- gchar *text = NULL;
- GVariant *channel_data;
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- GVariant *icon_id;
-#endif
- send_data = sat_manager_send_data_noti(ctx, cp_name, (struct tel_sat_send_channel_tlv*) &p_ind->proactive_ind_data.send_data);
-
- if(!send_data){
- dbg("no send data data");
- return TRUE;
- }
-
- //TODO check the data for sat-ui
-
- dbg("send data type_format(%s)", g_variant_get_type_string(send_data));
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- g_variant_get(send_data, "(isi@vib@vi)", &command_id, &text, &text_len, &icon_id, &channel_id, &send_data_immediately, &channel_data, &channel_data_len);
-#else
- g_variant_get(send_data, "(isiib@vi)", &command_id, &text, &text_len, &channel_id, &send_data_immediately, &channel_data, &channel_data_len);
-#endif
- /*telephony_sat_emit_send_data(sat, command_id, text, text_len, channel_id, send_data_immediately, channel_data, channel_data_len);*/
-
- //bip proactive command is only handled by BIP Manager
- {
- GDBusConnection *conn = NULL;
- const gchar *g_path = NULL;
-
- conn = g_dbus_object_manager_server_get_connection(ctx->manager);
- g_path = g_dbus_object_get_object_path(G_DBUS_OBJECT(object));
-
- sat_ui_support_exec_bip(conn, g_path, SAT_PROATV_CMD_SEND_DATA, send_data);
- }
- g_free(text);
- } break;
-
- case SAT_PROATV_CMD_GET_CHANNEL_STATUS:{
- GVariant *channel_status = NULL;
-
- gint command_id;
-
- channel_status = sat_manager_get_channel_status_noti(ctx, cp_name, (struct tel_sat_get_channel_status_tlv*) &p_ind->proactive_ind_data.get_channel_status);
-
- if(!channel_status){
- dbg("no get channel status data");
- return TRUE;
- }
-
- //TODO check the data for sat-ui
-
- dbg("get channel status type_format(%s)", g_variant_get_type_string(channel_status));
- g_variant_get(channel_status, "(i)", &command_id);
-
- /*telephony_sat_emit_get_channel_status(sat, command_id);*/
-
- //bip proactive command is only handled by BIP Manager
- {
- GDBusConnection *conn = NULL;
- const gchar *g_path = NULL;
-
- conn = g_dbus_object_manager_server_get_connection(ctx->manager);
- g_path = g_dbus_object_get_object_path(G_DBUS_OBJECT(object));
-
- sat_ui_support_exec_bip(conn, g_path, SAT_PROATV_CMD_GET_CHANNEL_STATUS, channel_status);
- }
- } break;
-
- case SAT_PROATV_CMD_REFRESH:{
- GVariant *refresh = NULL;
- gint command_id = 0;
- gint refresh_type =0;
- GVariant *file_list = NULL;
- int ret;
-
- refresh = sat_manager_refresh_noti(ctx, cp_name, (struct tel_sat_refresh_tlv*) &p_ind->proactive_ind_data.refresh);
-
- if(!refresh){
- dbg("no refresh data");
- return TRUE;
- }
-
- dbg("refresh type_format(%s)", g_variant_get_type_string(refresh));
- g_variant_get(refresh, "(ii@v)", &command_id, &refresh_type, &file_list);
-
- telephony_sat_emit_refresh(sat, command_id, refresh_type, file_list);
- ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_REFRESH, refresh, slot_id);
- if(!ret) {
- int rv;
- dbg("fail to launch sat-ui, remove the queued data!!\n");
- if(!sat_manager_handle_sat_ui_launch_fail(ctx, cp_name, p_ind))
- dbg("Fail to send terminal response\n");
- rv = sat_manager_remove_cmd_by_id(ctx, command_id);
- if(!rv)
- dbg("fail to dequeue data\n");
- }
- }break;
-
- case SAT_PROATV_CMD_MORE_TIME:{
- sat_manager_more_time_noti(ctx, cp_name, (struct tel_sat_more_time_tlv*) &p_ind->proactive_ind_data.more_time);
- telephony_sat_emit_more_time(sat);
- }break;
-
- case SAT_PROATV_CMD_SEND_DTMF:{
- GVariant *send_dtmf = NULL;
- gint command_id = 0;
- gint text_len = 0, dtmf_str_len = 0;
- gchar *text = NULL;
- gchar *dtmf_str = NULL;
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- GVariant *icon_id = NULL;
-#endif
- send_dtmf = sat_manager_send_dtmf_noti(ctx, cp_name, (struct tel_sat_send_dtmf_tlv*) &p_ind->proactive_ind_data.send_dtmf);
- if(!send_dtmf){
- dbg("no send_dtmf data");
- return TRUE;
- }
-
- dbg("send_dtmf type_format(%s)", g_variant_get_type_string(send_dtmf));
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- g_variant_get(send_dtmf, "(isi@vis)", &command_id, &text, &text_len, &icon_id, &dtmf_str_len, &dtmf_str);
-#else
- g_variant_get(send_dtmf, "(isiis)", &command_id, &text, &text_len, &dtmf_str_len, &dtmf_str);
-#endif
- if(text_len > 1 && (g_strcmp0(text,"") != 0) ){
- GVariant *ui_info = NULL;
- gboolean user_confirm = FALSE;
- int ret;
- dbg("text should be displayed by ui");
- dbg("send dtmf is displayed!!!");
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- ui_info = g_variant_new("(isibv)", command_id, text, text_len, user_confirm, icon_id);
-#else
- ui_info = g_variant_new("(isib)", command_id, text, text_len, user_confirm);
-#endif
- ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_SEND_DTMF, ui_info, slot_id);
- if(!ret) {
- int rv;
- dbg("fail to launch sat-ui, remove the queued data!!\n");
- if(!sat_manager_handle_sat_ui_launch_fail(ctx, cp_name, p_ind))
- dbg("Fail to send terminal response\n");
- rv = sat_manager_remove_cmd_by_id(ctx, command_id);
- if(!rv)
- dbg("fail to dequeue data\n");
- }
- g_free(text);
- g_free(dtmf_str);
- return TRUE;
- }
-#if !defined(TIZEN_PLATFORM_USE_QCOM_QMI)
- telephony_sat_emit_send_dtmf(sat, command_id, text, text_len, dtmf_str, dtmf_str_len);
-#endif
- g_free(text);
- g_free(dtmf_str);
- }break;
-
- case SAT_PROATV_CMD_LAUNCH_BROWSER:{
- GVariant *launch_browser = NULL;
- gint command_id = 0;
- gint browser_launch_type = 0, browser_id = 0;
- gint url_len = 0, text_len = 0, gateway_proxy_len =0;
- gchar *url = NULL;
- gchar *text = NULL;
- gchar *gateway_proxy = NULL;
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- GVariant *icon_id = NULL;
-#endif
- launch_browser = sat_manager_launch_browser_noti(ctx, cp_name, (struct tel_sat_launch_browser_tlv*) &p_ind->proactive_ind_data.launch_browser);
- if(!launch_browser){
- dbg("no launch_browser data");
- return TRUE;
- }
-
- dbg("launch_browser type_format(%s)", g_variant_get_type_string(launch_browser));
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- g_variant_get(launch_browser, "(iiisisisi@v)", &command_id, &browser_launch_type, &browser_id, &url, &url_len, &gateway_proxy, &gateway_proxy_len, &text, &text_len, &icon_id);
-#else
- g_variant_get(launch_browser, "(iiisisisi)", &command_id, &browser_launch_type, &browser_id, &url, &url_len, &gateway_proxy, &gateway_proxy_len, &text, &text_len);
-#endif
- //Popup is mendatory option in browser case
- {
- GVariant *ui_info = NULL;
- gboolean user_confirm = TRUE;
- int ret;
- dbg("text should be displayed by ui");
- dbg("launch browser is displayed!!!");
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- ui_info = g_variant_new("(isibv)", command_id, text, text_len, user_confirm, icon_id);
-#else
- ui_info = g_variant_new("(isib)", command_id, text, text_len, user_confirm);
-#endif
- ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_LAUNCH_BROWSER, ui_info, slot_id);
- if(!ret) {
- int rv;
- dbg("fail to launch sat-ui, remove the queued data!!\n");
- if(!sat_manager_handle_sat_ui_launch_fail(ctx, cp_name, p_ind))
- dbg("Fail to send terminal response\n");
- rv = sat_manager_remove_cmd_by_id(ctx, command_id);
- if(!rv)
- dbg("fail to dequeue data\n");
- }
- g_free(url);
- g_free(text);
- g_free(gateway_proxy);
- return TRUE;
- }
- }break;
-
- case SAT_PROATV_CMD_PROVIDE_LOCAL_INFO:{
- GVariant *provide_info = NULL;
- gint info_type = 0;
-
- provide_info = sat_manager_provide_local_info_noti(ctx, cp_name, (struct tel_sat_provide_local_info_tlv*) &p_ind->proactive_ind_data.provide_local_info);
- if(!provide_info){
- dbg("no provide_info data");
- return TRUE;
- }
-
- dbg("provide_info type_format(%s)", g_variant_get_type_string(provide_info));
- g_variant_get(provide_info, "(i)", &info_type);
-
- telephony_sat_emit_provide_local_info(sat, info_type);
- }break;
-
- case SAT_PROATV_CMD_LANGUAGE_NOTIFICATION:{
- GVariant *language_noti = NULL;
- gint command_id = 0;
- gint language = 0;
- gboolean b_specified = FALSE;
-
- language_noti = sat_manager_language_notification_noti(ctx, cp_name, (struct tel_sat_language_notification_tlv*) &p_ind->proactive_ind_data.language_notification);
- if(!language_noti){
- dbg("no language_noti data");
- return TRUE;
- }
-
- dbg("language_noti type_format(%s)", g_variant_get_type_string(language_noti));
- g_variant_get(language_noti, "(iib)", &command_id, &language, &b_specified);
-
- sat_manager_update_language(ctx, cp_name, language_noti);
-
- telephony_sat_emit_language_notification(sat, command_id, language, b_specified);
- }break;
-
- default:{
- gboolean rv = FALSE;
- rv = sat_manager_processing_unsupport_proactive_command(ctx, cp_name, (struct tel_sat_unsupproted_command_tlv*) &p_ind->proactive_ind_data.unsupport_cmd);
- dbg("not handled ind->cmd_type[0x%x] send error tr result(%d)", p_ind->cmd_type, rv);
- }break;
- }
- } break;
- default:
- err("Unhandled Notification: [0x%x]", command);
- break;
- }
-
- return TRUE;
-}
-
+++ /dev/null
-/*
- * tel-plugin-dbus_tapi
- *
- * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * @open
- * @ingroup TelephonyAPI
- * @addtogroup TAPI_CALL CALL
- * @{
- *
- * @file TelCall.h
-
- @brief This file serves as a "C" header file defines structures for Tapi Call Services. \n
- It contains a sample set of constants, enums, structs that would be required by applications.
- */
-
-#ifndef _TEL_CALL_H_
-#define _TEL_CALL_H_
-
-#include <TelSs.h>
-#include <TelDefines.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define TAPI_CALLING_NAME_SIZE_MAX 80 /**< The maximum length of the string for calling party name. */
-#define TAPI_CALL_UUS_DATA_LEN_MAX 131 /**< The Maximum length of the user to user singnalling data string. */
-#define TAPI_CALL_DISPLAY_RECORD_MAX 32 /**< The maximum length of the string for display record in CDMA */
-#define MAX_TAPI_CALL_COUNT 6 /**< Maximum number of call can be possible at a time */
-#define MAX_TAPI_CONF_CALL_COUNT 5 /**< Maximum number of Call can be possible in a conference call at a time */
-#define INVALID_CALL_HANDLE 0 /**< TS_UINT is used for call handle */
-
-/* Call */
-#define TAPI_CALL_DIALDIGIT_LEN_MAX 82 /**< Maximum Dialling Digit Length */
-#define TAPI_CALL_SUBADDRESS_LEN_MAX 40 /**< Maximum Call Subaddress Length */
-#define TAPI_CALL_NUMBER_LEN_MAX 7 /**< Dialling Num length */
-#define TAPI_CONTEXT_CALL_SIZE_MAX 6 /**< Maximum Call context */
-#define TAPI_CALL_DIAL_NUMBER_LEN_MAX 82
-
-#define TAPI_INVALID_CONTEXTHANDLE (HTapiContext)-1
-#define TAPI_CLIENT_SIZE_MAX 30
-#define TAPI_CALL_CUSTOM_SERVICE_DATA_MAX 128
-
-/**
- * @enum TelCallCause_t
- * This structure defines the values for Call Cause.
- */
-typedef enum {
- TAPI_CAUSE_SUCCESS, /**< Success */
- TAPI_CAUSE_ACCESSDISCARD, /**< Access discarded */
- TAPI_CAUSE_BARR_BYOPERATOR, /**< Barred by operator */
- TAPI_CAUSE_BEARERMODE_NOTIMPL, /**< Bearer mode not implemented */
- TAPI_CAUSE_BEARERMODE_RESTRICTED, /**< Bearer mode restricted */
- TAPI_CAUSE_BEARERMODE_UNAUTH, /**< Bearer mode un authorized */
- TAPI_CAUSE_BEARERMODE_UNAVAIL, /**< Bearer mode not available */
- TAPI_CAUSE_BUSY, /**< (Network/Server) busy */
- TAPI_CAUSE_CALLMETER_EXPIRED, /**< Call meter expired */
- TAPI_CAUSE_CALLNO_ERROR, /**< Call number error */
- TAPI_CAUSE_CKTUNAVAIL, /**< Circuit channel unavailable */ //10
- TAPI_CAUSE_CONGESTION, /**< Congestion happened */
- TAPI_CAUSE_NO_CIRCUIT_AVAIL, /**< Circuit not available */
- TAPI_CAUSE_DESTIN_INCOMPAT, /**< Destination incompatibility */
- TAPI_CAUSE_DTMF_NOSPEECH, /**< No speech in DTMF */
- TAPI_CAUSE_DTMF_REJECTED, /**< DTMF rejected */
- TAPI_CAUSE_FACILITY_NOTIMPL, /**< Facility not implemented */
- TAPI_CAUSE_FACILITY_NOTSUBSCRIBED, /**< Facility not subscribed */
- TAPI_CAUSE_INCOMINGCUGCALLS_BARRED, /**< Incoming CUG Calls barred */
- TAPI_CAUSE_INVALNUM, /**< Invalid number */
- TAPI_CAUSE_MPTY_ERROR, /**< Multiparty error */ //20
- TAPI_CAUSE_NOANSWER, /**< No answer */
- TAPI_CAUSE_NONCUGMEMBER, /**< Non CUG member */
- TAPI_CAUSE_NUMBERCHANGED, /**< Number changed */
- TAPI_CAUSE_NUMBER_ERROR, /**< Number error */
- TAPI_CAUSE_NWFAILURE, /**< Network failure */
- TAPI_CAUSE_OPERATIONUNAVAIL, /**< Operation not available */
- TAPI_CAUSE_OUTOFORDER, /**< Out of order */
- TAPI_CAUSE_PROTOCOL_ERROR, /**< Protocol error */
- TAPI_CAUSE_QOSUNAVAIL, /**< QOS unavailable */
- TAPI_CAUSE_REJECT, /**< Rejected */ //30
- TAPI_CAUSE_REJ_FAIL, /**< Rejection failed */
- TAPI_CAUSE_REJ_SRVC_NOT_AVL, /**< Rejection service not available */
- TAPI_CAUSE_REMOTE_CKTUNAVAIL, /**< Remote Circuit channel unavailable */
- TAPI_CAUSE_RESOURCEUNAVAIL, /**< Resource not available */
- TAPI_CAUSE_SERVICEID_ERROR, /**< Service id error */
- TAPI_CAUSE_SERVICE_NOTIMPL, /**< Service not implemented */
- TAPI_CAUSE_SERVICE_UNAVAIL, /**< Service not available */
- TAPI_CAUSE_MODIFY_SAME_BEARER, /**< Modify same bearer */
- TAPI_CAUSE_MODIFY_NOT_PERMITTED, /**< Modification not permitted */
- TAPI_CAUSE_HOLD_FAIL, /**< Call hold fail */ //40
- TAPI_CAUSE_TEMPFAILURE, /**< Temporary failure */
- TAPI_CAUSE_WRONGNUM, /**< Wrong number */
- TAPI_CAUSE_NORMAL_UNSPECIFIED, /**< Normal but unspecified */
- TAPI_CAUSE_SSERRINVALIDTIVALUE, /**< SS invalid Transaction ID Value */
- TAPI_CAUSE_SSERRINVALIDTI, /**< SS Invalid transaction ID */
- TAPI_CAUSE_SSINCOMPATIBLESTATE, /**< SS incompatible state */
- TAPI_CAUSE_SSERRSYNTAXERROR, /**< SS syntax error */
- TAPI_CAUSE_SSPROTOCOLERROR, /**< Protocol error */
- TAPI_CAUSE_SSNEGATIVEPASSWORDCHECK, /**< Negative password check */
- TAPI_CAUSE_SSSENTASPHASE1, /**< SS sent as phase1 message */ //50
- TAPI_CAUSE_SSERROR, /**< Supplementary service error */
- TAPI_CAUSE_SS_USSD_BUSY, /**< Second USSD request will be rejected when already USSD transaction is ongoing. */
- TAPI_CAUSE_IDLE, /**< Idle */
- TAPI_CAUSE_NETWORK_SPECIFIC, /**< Network specific error */
- TAPI_CAUSE_FADE, /**< voice call was dropped e.g. because of a loss of signal */
- TAPI_CAUSE_UNKNOWN, /**< unknown no details available */
- TAPI_CAUSE_INCOM_CALL, /**< terminated by incoming call */
- TAPI_CAUSE_ALERT_STOP, /**< terminated by alert stop */
- TAPI_CAUSE_INTERCEPT, /**< voice call was dropped by interception */
- TAPI_CAUSE_REORDER, /**< voice call was dropped by reordering */ //60
- TAPI_CAUSE_CLIENT_END, /**< client ended the call */
- TAPI_CAUSE_ACCESS_CLASS_BLOCKED, /**< access class blocked */
- TAPI_CAUSE_MEMCAPEXCEEDED, /**< Memory capacity exceeded */
- TAPI_CAUSE_TYPENOTSUPPORTED, /**< Type not supported */
- TAPI_CAUSE_REPLACENOTSUPPORTED, /**< Replace not supported */
- TAPI_CAUSE_PROTOCOLID_ERROR, /**< Protocol id error */
- TAPI_CAUSE_CLASSNOTSUPPORTED, /**< Class not supported */
- TAPI_CAUSE_DATACODING_ERROR, /**< Data coding error */
- TAPI_CAUSE_INVAL_MSG, /**< Invalid message */
- TAPI_CAUSE_CALL_BARRED, /**< Call barred */ //70
- TAPI_CAUSE_SIM_CALL_CONTROL_CHANGED_TO_SS, /**< Sim call control changed to SS */
- TAPI_CAUSE_SIM_CALL_CONTROL_CHANGED_TO_CALL, /**< SIM Call control changed to call */
- TAPI_CAUSE_SIM_ERROR, /**< SIM error */
- TAPI_CAUSE_SIM_CALL_CONTROL_MODIFIED, /**< SIM call control modified */
- TAPI_CAUSE_RANDOM_ACCESS_FAILURE, /**< Random access error */
- TAPI_CAUSE_LOWER_LAYER_FAILURE, /**< Lower layer error */
- TAPI_CAUSE_ACCESS_REJECTED, /**< Access rejected */
- TAPI_CAUSE_RESET_NOT_ALLOWED, /**< Reset not allowed */
- TAPI_CAUSE_EMERGENCY_CALL_NOT_ALLOWED, /**< Emergency call not allowed */
- TAPI_CAUSE_ACCESS_NOT_ALLOWED, /**< Access not allowed */ //80
- TAPI_CAUSE_RADIO_LINK_FAILURE, /**< Radio link failure */
- TAPI_CAUSE_INVALID_IDENTITY, /**< Invalid identity */
- TAPI_CAUSE_UNKNOWN_IDENTITY, /**< Unknown identity */
- TAPI_CAUSE_UNACCEPTABLE_IDENTITY, /**< Un acceptable identity */
- TAPI_CAUSE_NO_SERVICE_HERE, /**< No service here */
- TAPI_CAUSE_SERVICE_NOT_ALLOWED, /**< Service not allowed */
- TAPI_CAUSE_SERVICE_NOT_AVAIL, /**< Service not available */
- TAPI_CAUSE_SERVICE_NOT_WORKING, /**< Service not working */
- TAPI_CAUSE_CANNOT_IDENTIFY_CALL, /**< Cannot identify the call */
- TAPI_CAUSE_DEACTIVATION, /**< Deactivation */ //90
- TAPI_CAUSE_FATAL_ERROR, /**< Fatal error */
- TAPI_CAUSE_SEND_DTMF_SUCCESS, /**< Sending DTMF Success */
- TAPI_CAUSE_SEND_DTMF_FAIL, /**< Sending DTMF Failed */
- TAPI_CAUSE_TIMER_EXPIRED, /**< Call Timer Expired */
-} TelCallCause_t;
-
-/**
- * @enum TelTapiEndCause_t
- * When a call is ended, this end cause is given with the CALL END notification to the application. This end cause can be originated
- * from different elements in the communication path or different modules in the same element.
- */
-typedef enum {
- TAPI_CALL_END_NO_CAUSE = 0x00, /**< No Cause */
-
- TAPI_CC_CAUSE_UNASSIGNED_NUMBER, /**< Unassigned Number */
- TAPI_CC_CAUSE_NO_ROUTE_TO_DEST, /**< No Route to Destination */
- TAPI_CC_CAUSE_CHANNEL_UNACCEPTABLE, /**< Channel Unacceptable */
- TAPI_CC_CAUSE_OPERATOR_DETERMINED_BARRING, /**< Operator Determined Barring */
- TAPI_CC_CAUSE_NORMAL_CALL_CLEARING, /**< Normal Call Clearing */
-
- TAPI_CC_CAUSE_USER_BUSY, /**< User Busy */
- TAPI_CC_CAUSE_NO_USER_RESPONDING, /**< No user Responding */
- TAPI_CC_CAUSE_USER_ALERTING_NO_ANSWER, /**< User Alerting no Answer */
- TAPI_CC_CAUSE_CALL_REJECTED, /**< Call Rejected */
- TAPI_CC_CAUSE_NUMBER_CHANGED, /**< Number Changed */
-
- TAPI_CC_CAUSE_NON_SELECTED_USER_CLEARING, /**< Non Selected User Clearing */
- TAPI_CC_CAUSE_DESTINATION_OUT_OF_ORDER, /**< Destination out of Order */
- TAPI_CC_CAUSE_INVALID_NUMBER_FORMAT, /**< Invalid Number Format */
- TAPI_CC_CAUSE_FACILITY_REJECTED, /**< Facility Rejected */
- TAPI_CC_CAUSE_RESPONSE_TO_STATUS_ENQUIRY, /**< Response to Status Enquiry */
-
- TAPI_CC_CAUSE_NORMAL_UNSPECIFIED, /**< Normal Unspecified */
- TAPI_CC_CAUSE_NO_CIRCUIT_CHANNEL_AVAILABLE, /**< No Circuit Channel Available */
- TAPI_CC_CAUSE_NETWORK_OUT_OF_ORDER, /**< Network out of Order */
- TAPI_CC_CAUSE_TEMPORARY_FAILURE, /**< Temporary Failure */
- TAPI_CC_CAUSE_SWITCHING_EQUIPMENT_CONGESTION, /**< Switching Equipment Congestion */
-
- TAPI_CC_CAUSE_ACCESS_INFORMATION_DISCARDED, /**< Access Information Discarded */
- TAPI_CC_CAUSE_REQUESTED_CIRCUIT_CHANNEL_NOT_AVAILABLE, /**< Requested Circuit channel not available */
- TAPI_CC_CAUSE_RESOURCES_UNAVAILABLE_UNSPECIFIED, /**< Resources unavailable unspecified */
- TAPI_CC_CAUSE_QUALITY_OF_SERVICE_UNAVAILABLE, /**< Quality of service unavailable */
- TAPI_CC_CAUSE_REQUESTED_FACILITY_NOT_SUBSCRIBED, /**< Requested facility not subscribed */
-
- TAPI_CC_CAUSE_INCOMING_CALL_BARRED_WITHIN_CUG, /**< incomming call barred within CUG */
- TAPI_CC_CAUSE_BEARER_CAPABILITY_NOT_AUTHORISED, /**< Bearer Capability not Authorised */
- TAPI_CC_CAUSE_BEARER_CAPABILITY_NOT_PRESENTLY_AVAILABLE,/**< Bearer capability not presently Available */
- TAPI_CC_CAUSE_SERVICE_OR_OPTION_NOT_AVAILABLE, /**< Service or Option not available */
- TAPI_CC_CAUSE_BEARER_SERVICE_NOT_IMPLEMENTED, /**< Service not implemented */
-
- TAPI_CC_CAUSE_ACM_GEQ_ACMMAX, /**< ACM GEQ ACMAX */
- TAPI_CC_CAUSE_REQUESTED_FACILITY_NOT_IMPLEMENTED, /**< Requested facility not implemented */
- TAPI_CC_CAUSE_ONLY_RESTRICTED_DIGITAL_INFO_BC_AVAILABLE,/**< Resticted digital info BC not available */
- TAPI_CC_CAUSE_SERVICE_OR_OPTION_NOT_IMPLEMENTED, /**< Service or Option not Implemented */
- TAPI_CC_CAUSE_INVALID_TRANSACTION_ID_VALUE, /**< Transaction ID value */
-
- TAPI_CC_CAUSE_USER_NOT_MEMBER_OF_CUG, /**< Not member of CUG */
- TAPI_CC_CAUSE_INCOMPATIBLE_DESTINATION, /**< Incompatible Destination */
- TAPI_CC_CAUSE_INVALID_TRANSIT_NETWORK_SELECTION, /**< Transit Network selection */
- TAPI_CC_CAUSE_SEMANTICALLY_INCORRECT_MESSAGE, /**< Semantically Incorrect message */
- TAPI_CC_CAUSE_INVALID_MANDATORY_INFORMATION, /**< Invalid Mandatory Message */
-
- TAPI_CC_CAUSE_MESSAGE_TYPE_NON_EXISTENT, /**< Message Type Non Existent */
- TAPI_CC_CAUSE_MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROT_STATE, /**< Message type not compatible with Prot state */
- TAPI_CC_CAUSE_IE_NON_EXISTENT_OR_NOT_IMPLEMENTED, /**< IE non exitent or not implemented */
- TAPI_CC_CAUSE_CONDITIONAL_IE_ERROR, /**< Conditional IE error */
- TAPI_CC_CAUSE_MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE, /**< Not Compatible with protocol state */
-
- TAPI_CC_CAUSE_RECOVERY_ON_TIMER_EXPIRY, /**< Recovery on timer expiry */
- TAPI_CC_CAUSE_PROTOCOL_ERROR_UNSPECIFIED, /**< Protocol error unspecified */
- TAPI_CC_CAUSE_INTERWORKING_UNSPECIFIED, /**< Interworking unspecified */
-
- TAPI_CC_CAUSE_END = 128,
-
- /* Reject causes*/
- TAPI_REJECT_CAUSE_IMSI_UNKNOWN_IN_HLR, /**< IMSI unknown in HLR */
- TAPI_REJECT_CAUSE_ILLEGAL_MS, /**< Illegal MS */
- TAPI_REJECT_CAUSE_IMSI_UNKNOWN_IN_VLR, /**< IMSI unknown in VLR */
- TAPI_REJECT_CAUSE_IMEI_NOT_ACCEPTED, /**< IMEI not accepted */
- TAPI_REJECT_CAUSE_ILLEGAL_ME, /**< Illegal ME */
-
- TAPI_REJECT_CAUSE_GPRS_SERVICES_NOT_ALLOWED, /**< GPRS service not allowed */
- TAPI_REJECT_CAUSE_GPRS_SERVICES_AND_NON_GPRS_SERVICES_NOT_ALLOWED, /**< GPRS services and Non-GPRS services not allowed */
- TAPI_REJECT_CAUSE_MS_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK, /**< MS device cannot be derived by the network */
- TAPI_REJECT_CAUSE_IMPLICITLY_DETACHED, /**< Implicitly detached */
- TAPI_REJECT_CAUSE_PLMN_NOT_ALLOWED, /**< PLMN not allowed */
-
- TAPI_REJECT_CAUSE_LA_NOT_ALLOWED, /**< LA not allowed */
- TAPI_REJECT_CAUSE_NATIONAL_ROAMING_NOT_ALLOWED, /**< National roaming not allowed */
- TAPI_REJECT_CAUSE_GPRS_SERVICES_NOT_ALLOWED_IN_THIS_PLMN, /**< GPRS services not allowed in this PLMN */
- TAPI_REJECT_CAUSE_NO_SUITABLE_CELLS_IN_LA, /**< No suitable cells in the LA */
- TAPI_REJECT_CAUSE_MSC_TEMPORARILY_NOT_REACHABLE, /**< MSC temporarily not reachable */
-
- TAPI_REJECT_CAUSE_NETWORK_FAILURE, /**< Network unavailable */
- TAPI_REJECT_CAUSE_MAC_FAILURE, /**< MAC failure */
- TAPI_REJECT_CAUSE_SYNCH_FAILURE, /**< SYNCh failure */
- TAPI_REJECT_CAUSE_CONGESTTION, /**< Congestion */
- TAPI_REJECT_CAUSE_GSM_AUTH_UNACCEPTED, /**< GSM Auth unaccepted */
-
- TAPI_REJECT_CAUSE_SERVICE_OPTION_NOT_SUPPORTED, /**< Service option not supported */
- TAPI_REJECT_CAUSE_REQ_SERV_OPT_NOT_SUBSCRIBED, /**< REQ_SERV option not suscribed */
- TAPI_REJECT_CAUSE_SERVICE_OPT__OUT_OF_ORDER, /**< Service OPT out of order */
- TAPI_REJECT_CAUSE_CALL_CANNOT_BE_IDENTIFIED, /**< Call cannot be identified */
- TAPI_REJECT_CAUSE_NO_PDP_CONTEXT_ACTIVATED, /**< No PDP context Activated */
-
- TAPI_REJECT_CAUSE_RETRY_UPON_ENTRY_INTO_A_NEW_CELL_MIN_VALUE, /**< Retry upon entry into a new call min value */
- TAPI_REJECT_CAUSE_RETRY_UPON_ENTRY_INTO_A_NEW_CELL_MAX_VALUE, /**< Retry upon entry into a new call max value */
- TAPI_REJECT_CAUSE_SEMANTICALLY_INCORRECT_MSG, /**< Semantically incorret message */
- TAPI_REJECT_CAUSE_INVALID_MANDATORY_INFO, /**< Invalid mandatory information */
- TAPI_REJECT_CAUSE_MESSAGE_TYPE_NON_EXISTANT, /**< Message type non-existant */
-
- TAPI_REJECT_CAUSE_MESSAGE_TYPE_NOT_COMP_PRT_ST, /**< Message type not COMP PRT ST */
- TAPI_REJECT_CAUSE_IE_NON_EXISTANT, /**< IE not existant */
- TAPI_REJECT_CAUSE_MSG_NOT_COMPATIBLE_PROTOCOL_STATE, /**< MSG not compatible protocol state */
-
- /* Connection Management establishment rejection cause */
- TAPI_REJECT_CAUSE_REJ_UNSPECIFIED, /**< rej unspecified */
-
- /* AS reject causes */
- TAPI_REJECT_CAUSE_AS_REJ_RR_REL_IND, /**< RR release indication */
- TAPI_REJECT_CAUSE_AS_REJ_RR_RANDOM_ACCESS_FAILURE, /**< Random Access Failure */
- TAPI_REJECT_CAUSE_AS_REJ_RRC_REL_IND, /**< RRC release indication */
- TAPI_REJECT_CAUSE_AS_REJ_RRC_CLOSE_SESSION_IND, /**< RRC close session indication */
- TAPI_REJECT_CAUSE_AS_REJ_RRC_OPEN_SESSION_FAILURE, /**< RRC open session failure */
- TAPI_REJECT_CAUSE_AS_REJ_LOW_LEVEL_FAIL, /**< Low level failure */
- TAPI_REJECT_CAUSE_AS_REJ_LOW_LEVEL_FAIL_REDIAL_NOT_ALLOWED, /**< Low level failure redial not alowed */
- TAPI_REJECT_CAUSE_AS_REJ_LOW_LEVEL_IMMED_RETRY, /**< low level immediate retry */
-
- /* MM reject causes */
- TAPI_REJECT_CAUSE_MM_REJ_INVALID_SIM, /**< invalid Sim */
- TAPI_REJECT_CAUSE_MM_REJ_NO_SERVICE, /**< No service */
- TAPI_REJECT_CAUSE_MM_REJ_TIMER_T3230_EXP, /**< Timer T3230 expire */
- TAPI_REJECT_CAUSE_MM_REJ_NO_CELL_AVAILABLE, /**< No call available */
- TAPI_REJECT_CAUSE_MM_REJ_WRONG_STATE, /**< wrong state */
- TAPI_REJECT_CAUSE_MM_REJ_ACCESS_CLASS_BLOCKED, /**< Access class blocked */
-
- /* Definitions for release ind causes between MM and CNM*/
- TAPI_REJECT_CAUSE_ABORT_MSG_RECEIVED, /**< Abort Message received */
- TAPI_REJECT_CAUSE_OTHER_CAUSE, /**< Other cause */
-
- /* CNM reject causes */
- TAPI_REJECT_CAUSE_CNM_REJ_TIMER_T303_EXP, /**< Timer T303 expiry */
- TAPI_REJECT_CAUSE_CNM_REJ_NO_RESOURCES, /**< Rejected due to unavailibilty of resources */
- TAPI_REJECT_CAUSE_CNM_MM_REL_PENDING, /**< MM release pending */
- TAPI_REJECT_CAUSE_CNM_INVALID_USER_DATA, /**< Invalid user data */
- TAPI_CALL_END_CAUSE_MAX = 255, /**< Maximum End Cause limit for gsm/wcdma */
-
- /* CDMA CALL END CAUSE */
- TAPI_CDMA_END_CAUSE_REL_BY_USER = 0x1001, /**< Call Released by User */
- TAPI_CDMA_END_CAUSE_REL_BY_NET, /**< Call Released by Network */
- TAPI_CDMA_END_CAUSE_REL_NET_BUSY, /**< Call Released because of Network busy */
- TAPI_CDMA_END_CAUSE_NO_SVC, /**< Call Released because of No Service area */
- TAPI_CDMA_END_CAUSE_FADING, /**< Call Released because of Fading */
- TAPI_CDMA_END_CAUSE_RELEASE_BY_REORDER, /**< Call Released because of reorder */
- TAPI_CDMA_END_CAUSE_RELEASE_BY_INTERCEPT, /**< Call Released because of intercept */
- TAPI_CDMA_END_CAUSE_SILENT_ZONE_RETRY, /**< Call Released because of silent zone retry */
- TAPI_CDMA_END_CAUSE_OTA_CALL_FAIL, /**< Call Released because of OTA cal failure */
- TAPI_CDMA_END_CAUSE_PHONE_OFFLINE, /**< Call Released because of phone offline */
- TAPI_CDMA_END_CAUSE_PHONE_IS_CDMA_LOCKED, /**< Call Released because of CDMA locked */
- TAPI_CDMA_END_CAUSE_FLASH_IS_IN_PROGRESS_ERR, /**< Call Released because of flash-is-in-progress error */
- TAPI_CDMA_END_CAUSE_E911_MODE_ERR, /**< Call Released because of e911 mode */
- TAPI_CDMA_END_CAUSE_OTHERS, /**< Call Released by Others */
- TAPI_CDMA_END_CAUSE_MAX /**< Maximum End Cause limit for cdma */
-} TelTapiEndCause_t;
-
-/**
- * @enum TelConferenceCallState_t
- * This enum defines the call conference states
- */
-typedef enum {
- TAPI_CALL_CONFERENCE_IDLE, /**< idle */
- TAPI_CALL_CONFERENCE_ACTIVE /**< active */
-} TelConferenceCallState_t;
-
-/**
- * @enum TelCallStates_t
- * Applications can use these sates or can have their own states.
- */
-typedef enum {
- TAPI_CALL_STATE_IDLE, /**< Call is in idle state - i.e. no call */
- TAPI_CALL_STATE_ACTIVE, /**< Call is in connected and conversation state */
- TAPI_CALL_STATE_HELD, /**< Call is in held state */
- TAPI_CALL_STATE_DIALING, /**< Call is in dialing state */
- TAPI_CALL_STATE_ALERT, /**< Call is in alerting state */
- TAPI_CALL_STATE_INCOMING, /**< Call is in incoming state */
- TAPI_CALL_STATE_WAITING, /**< Call is in answered state, and waiting for connected indication event */
- TAPI_CALL_STATE_MAX
-} TelCallStates_t;
-
-/**
- * IN GSM ONLY: call identification number.
- */
-typedef enum {
- TAPI_CALL_ACTIVE_LINE1, /**< Line 1 */
- TAPI_CALL_ACTIVE_LINE2 /**< Line 2 */
-} TelCallActiveLine_t;
-
-typedef enum {
- TAPI_CALL_UUS_NONE, /**< No User to User information */
- TAPI_CALL_UUS_1, /**< User to User information 1 */
-} TelCallUusType_t;
-
-/**
- * The Incoming call indication could have be one of the following SS info messages in it.
- */
-typedef enum {
- /* Number details are present in the "char number" of call info struct. if number is not present
- then "no cli cause" member in mt_ss_info is set accordingly. */
- TAPI_CALL_MT_CLI_PRESENT = 0x31,
-
- /* Calling Name Info presnet, TelCallingNameInfo_t of call info struct contains this info. */
- TAPI_CALL_MT_CNA_PRESENT = 0x32,
-
- /* Undefined ss indication. Ignore mt_ss_info */
- TAPI_CALL_MT_SS_UNDEFINED = 0x00,
-
-} TelCallMtSSInfo_t;
-
-/**
- * @enum TelCallAnswerType_t
- * Answer type used as in parameter in the answer call API.
- */
-typedef enum {
- TAPI_CALL_ANSWER_ACCEPT = 0, /**< Used to answer an incoming call when there are no current active calls. */
- TAPI_CALL_ANSWER_REJECT, /**< Used to reject the incoming call */
- TAPI_CALL_ANSWER_REPLACE, /**< Release current active call and accept the */
- TAPI_CALL_ANSWER_HOLD_AND_ACCEPT, /**< Hold the current active call, and accept the wating call */
-} TelCallAnswerType_t;
-
-/**
- * @enum TelCallEndType_t
- * End type used as in parameter in the end call API.
- */
-typedef enum {
- TAPI_CALL_END = 0,
- TAPI_CALL_END_ALL,
- TAPI_CALL_END_ACTIVE_ALL,
- TAPI_CALL_END_HOLD_ALL,
-} TelCallEndType_t;
-
-
-
-
-/**
- * @enum TelCallType_t
- * Applications needs to use this call type while using the setup call API. Like the requested call is a voice call or video call.
- */
-typedef enum {
- TAPI_CALL_TYPE_VOICE, /**< Voice call type. */// in ipcv4, 0x0100
- TAPI_CALL_TYPE_DATA, /**< Data call type - (for modem, fax, packet, etc. calls). */// in ipcv4, 0x0200
- TAPI_CALL_TYPE_E911 /**< Emergency call type. */// in ipcv4, 0x0700
-} TelCallType_t;
-
-/**
- * @enum TelCallAlertingPattern_t
- * This enumeration defines the different alerting patterns available.
- */
-typedef enum {
- TAPI_CALL_ALERTING_PATTERN_1 = 0x00, /**< Pattern 1 */
- TAPI_CALL_ALERTING_PATTERN_2 = 0x01, /**< Pattern 2 */
- TAPI_CALL_ALERTING_PATTERN_3 = 0x02, /**< Pattern 3 */
- TAPI_CALL_ALERTING_PATTERN_4 = 0x03, /**< Pattern 4 */
- TAPI_CALL_ALERTING_PATTERN_5 = 0x04, /**< Pattern 5 */
- TAPI_CALL_ALERTING_PATTERN_6 = 0x05, /**< Pattern 6 */
- TAPI_CALL_ALERTING_PATTERN_7 = 0x06, /**< Pattern 7 */
- TAPI_CALL_ALERTING_PATTERN_8 = 0x07, /**< Pattern 8 */
- TAPI_CALL_NO_ALERTING_PATTERN = 0x08 /**< No Alerting Pattern */
-} TelCallAlertingPattern_t;
-
-/**
- * @enum TelCallActiveState_t
- * State of the current call.
- */
-typedef enum {
- TAPI_CALL_CONNECT_IDLE, /**< Call is in Idle state. */
- TAPI_CALL_CONNECT_ACTIVE, /**< Call is in Active state.*/
- TAPI_CALL_CONNECT_HELD /**< Call is in Held state. */
-} TelCallActiveState_t;
-
-/**
- * @enum TelCallCugOptions_t
- * This enumeration defines the closed user group options
- */
-typedef enum {
- TAPI_CALL_CUG_NO_INFO = 0x00, /**< No information */
- TAPI_CALL_CUG_SUPRESS_OA, /**< suppress OA */
- TAPI_CALL_CUG_SUPRESS_PRF_CUG, /**< suppress preferential CUG */
- TAPI_CALL_CUG_SUPRESS_OA_AND_CUG /**< suppress OA and preferential CUG */
-} TelCallCugOptions_t;
-
-/**
- * @enum TelCallUusProtocolType_t
- * This enumeration defines the tapi call uus protocol types
- */
-typedef enum {
- TAPI_CALL_UUS_PROTO_SPECIFIC = 0, /**< The user information is structured according to user needs. */
- TAPI_CALL_UUS_PROTO_OSI_HIGHER_LAYER = 1, /**< OSI high layer protocols */
- TAPI_CALL_UUS_PROTO_IA5_CHARS = 4, /**< user information consists of IA5 characters */
- TAPI_CALL_UUS_PROTO_V120 = 7, /**< rate adaptation */
- TAPI_CALL_UUS_PROTO_Q931 = 8 /**< user-network call control messages */
-} TelCallUusProtocolType_t;
-
-/**
- * @enum TelCallNameMode_t
- * This enumeration defines the call name mode
- */
-typedef enum {
- TAPI_CALL_NAME_AVAIL = 0, /**< This identifier refers to the presentation of the calling party's name identity to the called party. */
- TAPI_CALL_NAME_RESTRICTED = 1, /**< This identifier refers to the restriction of presentation of the name identity of the calling party to the called party. */
- TAPI_CALL_NAME_UNAVAIL = 2, /**< This identifier refers to the unavailability of the calling party's name identity to be offered to the called party. */
- TAPI_CALL_NAME_AVAIL_RESTRICTED = 3 /**< This identifier refers to the calling party's name identity to be offered to the called party with which presentation restriction is overridden. */
-} TelCallNameMode_t;
-
-/**
- * @enum TelCallNocliCause_t
- * This enumeration defines the value for "No Cli cause".
- */
-typedef enum {
- TAPI_CALL_NO_CLI_CAUSE_NONE = -1, /**< None */
- TAPI_CALL_NO_CLI_CAUSE_UNAVAILABLE = 0x00, /**< Unavailable */
- TAPI_CALL_NO_CLI_CAUSE_REJECTBY_USER = 0x01, /**< Rejected by User */
- TAPI_CALL_NO_CLI_CAUSE_INTERACTION_OTHERSERVICES = 0x02, /**< Other services */
- TAPI_CALL_NO_CLI_CAUSE_COINLINE_PAYPHONE = 0x03, /**< Coin line phone */
-} TelCallNocliCause_t;
-
-/**
- * @enum TelCallCliMode_t
- * This enumeration defines the value for "Cli mode".
- */
-typedef enum {
- TAPI_CALL_PRES_AVAIL, /** <Presentation Allowed */
- TAPI_CALL_PRES_RESTRICTED, /**<Presentation Restricted */
- TAPI_CALL_NUM_UNAVAIL, /**<Number Not Available */
-}TelCallCliMode_t;
-/**
- * Fwded Ind Type used for MO and Mt from SS Noti Info
- */
-typedef enum {
- TAPI_CALL_OUTGOING_FWDED = 0x00, /* Outgoing call forwarded */
- TAPI_CALL_INCOMMING_FWDED = 0x01, /* Incoming call forwarded */
-} TelCallForwardType_t;
-
-/**
- * @enum TelCallPrivacyMode_t
- * This structure contains the voice privacy option mode(CDMA only).
- */
-typedef enum {
- TAPI_CALL_PRIVACY_MODE_STANDARD = 0x00, /**< Standard mode */
- TAPI_CALL_PRIVACY_MODE_ENHANCED /**< Enhanced mode */
-} TelCallPrivacyMode_t;
-
-/**
- * @enum TelCallPrivacyType_t
- * This structure contains the voice privacy request type(CDMA only).
- */
-typedef enum {
- TAPI_CALL_PRIVACY_TYPE_MS = 0x01, /**< Mobile Station Voice Privacy Mode */
- TAPI_CALL_PRIVACY_TYPE_BS, /**< Base Station Voice Privacy Mode */
- TAPI_CALL_PRIVACY_TYPE_CURRENT /**< Current Serving Privacy Mode */
-} TelCallPrivacyType_t;
-
-/**
- * @enum TelCallEmergecyMode_t
- * This structure contains the emergency callback mode(CDMA only).
- */
-typedef enum {
- TAPI_CALL_EMERGENCY_MODE_EXIT, /**< Emergency CB Exit mode */
- TAPI_CALL_EMERGENCY_MODE_ENTER /**< Emergency CB Enter mode */
-} TelCallEmergecyMode_t;
-
-/**
- * @enum TelCallOtaType_t
- * This structure contains the OTA type(CDMA only).
- */
-typedef enum {
- TAPI_CALL_OTATYPE_OTASP = 0x01, /**< OTASP : mobile initiated OTA*/
- TAPI_CALL_OTATYPE_OTAPA, /**< OTAPA : network initiated OTA */
-} TelCallOtaType_t;
-
-/**
- * @enum TelCallOtaspStatus_t
- * This structure contains the OTASP Status(CDMA only).
- */
-typedef enum {
- TAPI_CALL_OTASP_OK_SPL_UNLOCKED = 0x01, /**< OTASP : SPL unlocked ok*/
- TAPI_CALL_OTASP_OK_AKEY_EXCESS, /**< OTASP : A-Key excess ok*/
- TAPI_CALL_OTASP_OK_SSD_UPDATE, /**< OTASP : SSD update ok */
- TAPI_CALL_OTASP_OK_NAM_DWNLD, /**< OTASP : NAM download ok */
- TAPI_CALL_OTASP_OK_MDN_DWNLD, /**< OTASP : MDN download ok */
- TAPI_CALL_OTASP_OK_IMSI_DWNLD, /**< OTASP : IMSI download ok*/
- TAPI_CALL_OTASP_OK_PRL_DWNLD, /**< OTASP : PRL download ok */
- TAPI_CALL_OTASP_OK_COMMIT, /**< OTASP : commit ok */
- TAPI_CALL_OTASP_OK_PROGRAMMING, /**< OTASP : programming ok */
- TAPI_CALL_OTASP_SUCCESS, /**< OTASP : success */
- TAPI_CALL_OTASP_UNSUCCESS, /**< OTASP : unsuccess */
- TAPI_CALL_OTASP_OK_OTAPA_VERIFY, /**< OTASP : verify ok */
- TAPI_CALL_OTASP_PROGRESS, /**< OTASP : progress */
- TAPI_CALL_OTASP_FAILURES_EXCESS_SPC, /**< OTASP : SPC excess failure */
- TAPI_CALL_OTASP_LOCK_CODE_PW_SET, /**< OTASP : lock code password set*/
-} TelCallOtaspStatus_t;
-
-/**
- * @enum TelCallOtapaStatus_t
- * This structure contains the OTAPA Status(CDMA only).
- */
-typedef enum {
- TAPI_CALL_OTAPA_STOP = 0x00, /**< OTAPA : stop */
- TAPI_CALL_OTAPA_START, /**< OTAPA : start */
-} TelCallOtapaStatus_t;
-
-/**
- * @enum TelCallTimeMaskType_t
- * This structure contains call time request mask type.
- */
-typedef enum {
- TAPI_CALL_TIME_TYPE_TOTAL_CALL_CNT = 0x01, /**< Total Call Count Mask */
- TAPI_CALL_TIME_TYPE_TOTAL_CALL_TIME = 0x02, /**< Total Call Time Mask */
- TAPI_CALL_TIME_TYPE_LAST_CALL_TIME = 0x04, /**< Last Call Time Mask */
-} TelCallTimeMaskType_t;
-
-/**
- * @enum TelCallToneDuration_t
- * This structure contains dtmf tone length.
- */
-typedef enum {
- TAPI_CALL_TONE_DURATION_SHORT = 0x01,
- TAPI_CALL_TONE_DURATION_LONG
-} TelCallToneDuration_t;
-
-/**
- * @enum TelCallEmergencyCategory_t
- * This structure contains emergency category type
- */
-typedef enum {
- TAPI_CALL_ECC_DEFAULT = 0x00,
- TAPI_CALL_ECC_POLICE = 0x01,
- TAPI_CALL_ECC_AMBULANCE = 0x02,
- TAPI_CALL_ECC_FIREBRIGADE = 0x04,
- TAPI_CALL_ECC_MARINEGUARD = 0x08,
- TAPI_CALL_ECC_MOUNTAINRESCUE = 0x10,
- TAPI_CALL_ECC_MANUAL_ECALL = 0x20,
- TAPI_CALL_ECCY_AUTO_ECALL = 0x40
-} TelCallEmergencyCategory_t;
-
-typedef enum {
- TAPI_CALL_IDENTITY_DEFAULT, /**< Calling line identity will be sent. Based on network setting, Line identity will presented to the called party. */
- TAPI_CALL_IDENTITY_SHOW, /**< Display calling line identity */
- TAPI_CALL_IDENTITY_HIDE /**< Hide the display of Calling line identity */
-} TelCallIdentityMode_t;
-
-
-/**
- * context type
- */
-typedef enum {
- TAPI_CONTEXT_TYPE_NONE = 0x00,
- TAPI_CONTEXT_TYPE_VOICE_CALL = 0x01,
- TAPI_CONTEXT_TYPE_DATA_CALL = 0x2,
- TAPI_CONTEXT_TYPE_VIDEO_CALL = 0x3,
- TAPI_CONTEXT_TYPE_NETTEXT,
- TAPI_CONTEXT_TYPE_E911,
-} TapiContextType;
-
-
-/**
- * Timer State and or Call Timer ID
- */
-typedef enum {
- TAPI_CALL_TSTATE_IDLE = 0x00, /**< No timer running */
- TAPI_CALL_TSTATE_SETUP_PENDING, /**< Setup Timer */
- TAPI_CALL_TSTATE_CONNECT_PENDING, /**< Connected Timer */
- TAPI_CALL_TSTATE_END_PENDING, /**< Release Timer */
- TAPI_CALL_TSTATE_HOLD_PENDING, /**< Hold Timer */
- TAPI_CALL_TSTATE_RETRIEVE_PENDING, /**< Retrieve Timer */
- TAPI_CALL_TSTATE_JOIN_PENDING, /**< Join Timer */
- TAPI_CALL_TSTATE_SPLIT_PENDING, /**< Split Timer */
- TAPI_CALL_TSTATE_ECT_PENDING, /**< ECT Timer */
- TAPI_CALL_TSTATE_DTMF_PENDING, /**< DTMF Timer */
-} TelTapiCallTimerState;
-
-typedef struct {
- TS_BOOL bRequestedBySAT; /** This flag is to indicate whether the request has been initiated by SAT or not.Possible values are 0 and 1. This flag should be updated only when originating a setup request */
- TelCallIdentityMode_t IdentityMode; /**< Sets Calling Line Identity mode. If default value TAPI_IDENTITY_DEFAULT is set, OEM will set the default value. */
- TelCallEmergencyCategory_t ecc;
-} tel_set_call_satflag_identiymode;
-
-/**
- * This structure contains information about the redirect destination information.
- */
-typedef struct {
- unsigned char number[TAPI_CALL_DIAL_NUMBER_LEN_MAX + 1]; /**< Redirect destination number */
-} TelCallDeflectDstInfo_t;
-
-/**
- * This structure defines the calling name information
- */
-typedef struct {
- TelCallNameMode_t NameMode; /**< Display mode of the szNameData. */
- char szNameData[TAPI_CALLING_NAME_SIZE_MAX]; /**< Calling party name string. */
-} TelCallingNameInfo_t;
-
-/**
- * This structure contains information about an outgoing call.
- */
-typedef struct {
- TelCallType_t CallType; /**< sets type of call (voice, data, video, emergency) */
- char szNumber[TAPI_CALL_DIALDIGIT_LEN_MAX + 1]; /**< A string containing the destination phone number. This follows the dial number format.*/
-} TelCallDial_t;
-
-/**
- * This structure contains information about call status.
- */
-typedef struct {
- int CallHandle;
- int bMoCall; /**< Status will be yes for MO Call. If MT call, then FALSE*/
- char pNumber[TAPI_CALL_DIALDIGIT_LEN_MAX + 1]; /**< Mobile Number */
- TelCallType_t CallType; /**< Specifies type of call (voice, data, emergency) */
- TelCallStates_t CallState; /**< Current Call state */
- int bConferenceState; /**< Whether Call is in Conference or not*/
-} TelCallStatus_t;
-
-typedef void (*TelCallStatusCallback)( TelCallStatus_t *out, void *user_data );
-
-
-/**
- * This structure contains information about call redirection details.
- */
-typedef struct {
- char szRedirectedNumber[TAPI_CALL_DIALDIGIT_LEN_MAX + 1]; /**< Redirected party number */
- char szRedirectSubAddress[TAPI_CALL_SUBADDRESS_LEN_MAX + 1]; /**< Redirect party sub-address */
-} TelCallRedirectionInfo_t;
-
-/**
- * This structure contains the incoming call information.
- */
-typedef struct {
- unsigned int CallHandle; /**< At Foundation API Level, Call handle indicates the Handle of the Call for the Application . At Framework API Level, call handle indicates the Call identifier used for call by the OEM Adaptation Layer Plug-in */
- TelCallType_t CallType; /**< Call type */
- TelSsLineIdentificationType_t CliPresentationIndicator; /**< Calling Party presentation indicator */
- char szCallingPartyNumber[TAPI_CALL_DIALDIGIT_LEN_MAX + 1]; /**< caller number,null terminated ASCII */
- TelCallingNameInfo_t CallingNameInfo; /**< Call name info. If there is no information from network, this information will be NULL.*/
- TelCallRedirectionInfo_t RedirectInfo; /**< The data for the Call Redirect information. If there is no information from network, this information will be NULL. */
- TelCallCliMode_t CliMode; /**<CLI Mode> */
- TelCallNocliCause_t CliCause; /**< No of CLI cause */
- int fwded; /**< True or false. If Incoming call is a forwarded call, then true else false. */
- TelCallActiveLine_t ActiveLine; /**< Current Active Line */
-} TelCallIncomingCallInfo_t;
-
-/**
- *SS Info message.
- */
-typedef struct {
- TelCallMtSSInfo_t type; /* Type of the SS Info presnet. */
- TelCallCliMode_t CliMode; /**<CLI Mode> */
- TelCallNocliCause_t no_cli_cause;
-} TelCallMtSsInfo_t; // not used
-
-typedef struct {
- int isMobileOriginated; /* Is this call Mobile Originated? */
- TelCallNameMode_t nameMode; /* Calling Party Name availability mode */
- char callNumber[TAPI_CALL_DIALDIGIT_LEN_MAX + 1]; /* A character array of the destination address. This follows the dial callNumber format. */
- unsigned int startTime; /* Time when a call is started */
- unsigned int endTime; /* Time when a call is ended */
- TelCallType_t callType; /* Type of a call */
- TelCallStates_t callState; /* State of a call */
- TelCallActiveState_t activeState; /* Status of a call */
- TelConferenceCallState_t conferenceState; /* State of a conference call */
- TelCallingNameInfo_t callingNameInfo; /* Calling name information of a call */
- TelCallActiveLine_t current_line; /* Line information of a call */
- TelCallCause_t cause; /* End type of a call when a call is ended */
- TelTapiEndCause_t endCause; /* EndCause */
-} TelTapiCallInfo_t;
-
-/**
- * This structure contains the connected number information.
- */
-typedef struct {
- TelCallCliMode_t CliMode; /**<CLI Mode> */
- TelCallNocliCause_t no_cli_cause; /**< Cause when no CLI number. */
- unsigned char dcs; /**< DCS */
- unsigned char number_type; /**< Number type */
- TelCallNameMode_t name_mode; /**< Display mode of the name. */
- char number[TAPI_CALL_DIALDIGIT_LEN_MAX + 1]; /**< Caller number, null terminated ASCII */
- char sub_address[TAPI_CALL_SUBADDRESS_LEN_MAX + 1]; /**< Called sub-address, null terminated ASCII */
-} TelCallConnectedNumberInfo_t;
-
-/**
- * This structure contains the voice privacy info(CDMA only).
- */
-typedef struct {
- TelCallPrivacyType_t PrivacyType; /**< Voice Privacy Request Type */
- TelCallPrivacyMode_t PrivacyMode; /**< Voice Privacy Mode */
-} TelCallVoicePrivacyInfo_t;
-
-/**
- * This structure contains the OTA progress indication information(CDMA only).
- */
-typedef struct {
- TelCallOtaType_t OtaType; /**< OTA type */
- TelCallOtaspStatus_t OtaspStatus; /**< OTASP status : if OTA type is OTASP, it is valid */
- TelCallOtapaStatus_t OtapaStatus; /**< OTAPA status : if OTA type is OTAPA, it is valid */
-} TelCallOtaProgressInfo_t;
-
-/**
- * This structure contains information about a call time and call count.
- */
-typedef struct {
- unsigned short req_type_mask; /**< call time request type */
- unsigned long TotalCallCnt; /**< Total Call Count */
- unsigned long OutgoingCallCnt; /**< Outgoing Call Count */
- unsigned long IncomingCallCnt; /**< Incoming Call Count */
- unsigned long TotalCallTime; /**< Overall Call Time(Outgoing + Incoming, in second) */
- unsigned long OutgoingCallTime; /**< Overall Outgoing Call Time(in second) */
- unsigned long IncomingCallTime; /**< Overall Incoming Call Time(in second) */
- unsigned long LastCallTime; /**< Last Call Time(in second) */
-} TelCallTimeInfo_t;
-
-/**
- * This structure contains information about display record in CDMA.
- */
-typedef struct {
- unsigned char Record[TAPI_CALL_DISPLAY_RECORD_MAX + 1]; /**< display record */
-} TelCallDisplayRecordInfo_t;
-
-// New Struct for New API
-typedef enum {
- TAPI_SOUND_MUTE =0x00, /**<Sound is mute*/
- TAPI_SOUND_VOLUME_LEVEL_1=0x01, /**<Volume level is 1*/
- TAPI_SOUND_VOLUME_LEVEL_2=0x02, /**<Volume level is 2*/
- TAPI_SOUND_VOLUME_LEVEL_3=0x03, /**<Volume level is 3*/
- TAPI_SOUND_VOLUME_LEVEL_4=0x04, /**<Volume level is 4*/
- TAPI_SOUND_VOLUME_LEVEL_5=0x05, /**<Volume level is 5*/
- TAPI_SOUND_VOLUME_LEVEL_6=0x06, /**<Volume level is 6*/
- TAPI_SOUND_VOLUME_LEVEL_7=0x07, /**<Volume level is 7*/
- TAPI_SOUND_VOLUME_LEVEL_8=0x08, /**<Volume level is 8*/
- TAPI_SOUND_VOLUME_LEVEL_9=0x09 /**<Volume level is 9*/
-} TelSoundVolume_t;
-
-typedef enum {
- TAPI_SOUND_RECORDING_OFF,
- TAPI_SOUND_RECORDING_ON,
-
-} TelSoundRecording_t;
-
-typedef enum {
- TAPI_SOUND_DEVICE_RECEIVER = 0x00,
- TAPI_SOUND_DEVICE_SPEAKER_PHONE = 0x10,
- TAPI_SOUND_DEVICE_HFK = 0x20,
- TAPI_SOUND_DEVICE_HEADSET = 0x30,
- TAPI_SOUND_DEVICE_BLUETOOTH = 0x40,
- TAPI_SOUND_DEVICE_EC = 0xA0,
-} TelSoundDevice_t;
-
-typedef enum {
- TAPI_SOUND_TYPE_VOICE = 0x01,
- TAPI_SOUND_TYPE_KEYTONE = 0x02,
- TAPI_SOUND_TYPE_BELL = 0x03,
- TAPI_SOUND_TYPE_MESSAGE = 0x04,
- TAPI_SOUND_TYPE_ALARM = 0x05,
- TAPI_SOUND_TYPE_PDA_MISC = 0x06,
-} TelSoundType_t;
-
-
-typedef struct {
- TelSoundDevice_t device;
- TelSoundType_t type;
- TelSoundVolume_t volume;
-} TelCallVolumeInfo_t;
-
-typedef enum {
- TAPI_SOUND_PATH_HANDSET =0x01, /**<Audio path is handset*/
- TAPI_SOUND_PATH_HEADSET =0x02, /**<Audio path is handset*/
- TAPI_SOUND_PATH_HANDSFREE =0x03, /**<Audio path is Handsfree*/
- TAPI_SOUND_PATH_BLUETOOTH =0x04, /**<Audio path is bluetooth*/
- TAPI_SOUND_PATH_STEREO_BLUETOOTH =0x05, /**<Audio path is stereo bluetooth*/
- TAPI_SOUND_PATH_SPK_PHONE =0x06, /**<Audio path is speaker phone*/
- TAPI_SOUND_PATH_HEADSET_3_5PI =0x07, /**<Audio path is headset_3_5PI*/
- TAPI_SOUND_PATH_BT_NSEC_OFF =0x08,
- TAPI_SOUND_PATH_MIC1 =0x09,
- TAPI_SOUND_PATH_MIC2 =0x0A,
- TAPI_SOUND_PATH_HEADSET_HAC =0x0B,
-} TelSoundPath_t;
-
-typedef struct {
- TelSoundPath_t path;
- enum ExtraVolumeStatus {
- TAPI_SOUND_EX_VOLUME_OFF,
- TAPI_SOUND_EX_VOLUME_ON,
- } ex_volume;
-} TelCallSoundPathInfo_t;
-
-typedef enum {
- TAPI_SOUND_MUTE_STATUS_OFF,
- TAPI_SOUND_MUTE_STATUS_ON,
-} TelSoundMuteStatus_t;
-
-typedef enum {
- TAPI_SOUND_NOISE_REDUCTION_OFF,
- TAPI_SOUND_NOISE_REDUCTION_ON,
-} TelSoundNoiseReduction_t;
-
-typedef enum {
- TAPI_SOUND_EQUALIZATION_MODE_OFF,
- TAPI_SOUND_EQUALIZATION_MODE_ON,
- TAPI_SOUND_EQUALIZATION_MODE_FLAG_OFF,
- TAPI_SOUND_EQUALIZATION_MODE_FLAG_ON,
- TAPI_SOUND_EQUALIZATION_MODE_SOFT1,
- TAPI_SOUND_EQUALIZATION_MODE_SOFT2,
-} TelSoundEqualizationMode_t;
-
-typedef enum {
- TAPI_SOUND_DIRECTION_LEFT,
- TAPI_SOUND_DIRECTION_RIGHT,
-} TelSoundDirection_t;
-
-
-#define MAX_SOUND_EQ_PARAMETER_SIZE 6
-typedef struct {
- TelSoundEqualizationMode_t mode;
- TelSoundDirection_t direction;
- unsigned short parameter[MAX_SOUND_EQ_PARAMETER_SIZE];
-} TelCallSoundEqualization_t;
-
-
-
-
-typedef struct {
- unsigned int id;
-} TelCallAnswerCnf_t;
-
-typedef struct {
- TelCallEndType_t type;
- unsigned int id;
-} TelCallEndCnf_t;
-
-typedef struct {
- unsigned int id;
-} TelCallHoldCnf_t;
-
-typedef struct {
- unsigned int id;
-} TelCallActiveCnf_t;
-
-typedef struct {
- unsigned int id;
-} TelCallSwapCnf_t;
-
-typedef struct {
- unsigned int id;
-} TelCallJoinCnf_t;
-
-typedef struct {
- unsigned int id;
-} TelCallSplitCnf_t;
-
-typedef struct {
- unsigned int id;
-} TelCallTransferCnf_t;
-
-typedef struct {
- unsigned int record_num;
- TelCallVolumeInfo_t record[ 20 ];
-} TelCallGetVolumeInfoResp_t;
-
-typedef struct {
- TelSoundMuteStatus_t status;
-} TelCallGetMuteStatusResp_t;
-
-
-
-
-
-
-typedef struct {
- unsigned int id;
- TelTapiEndCause_t cause; /**< End cause for the call indicates whether the call is released normally or due to other cause*/
-} TelCallStatusIdleNoti_t;
-
-typedef struct {
- unsigned int id;
-} TelCallStatusActiveNoti_t;
-
-typedef struct {
- unsigned int id;
-} TelCallStatusHeldNoti_t;
-
-typedef struct {
- unsigned int id;
-} TelCallStatusDialingNoti_t;
-
-typedef struct {
- unsigned int id;
-} TelCallStatusAlertNoti_t;
-
-typedef struct {
- unsigned int id;
-} TelCallStatusIncomingNoti_t;
-
-typedef struct {
- unsigned int id;
-} TelCallStatusWaitingNoti_t;
-
-typedef struct {
- unsigned int id;
-} TelCallInfoWaitingNoti_t;
-
-typedef struct {
- unsigned int id;
-} TelCallInfoForwardedNoti_t;
-
-typedef struct {
- unsigned int id;
-} TelCallInfoForwardedCallNoti_t;
-
-typedef struct {
- unsigned int id;
-} TelCallInfoBarredIncomingNoti_t;
-
-typedef struct {
- unsigned int id;
-} TelCallInfoBarredOutgoingNoti_t;
-
-typedef struct {
- unsigned int id;
-} TelCallInfoForwardConditionalNoti_t;
-
-typedef struct {
- unsigned int id;
-} TelCallInfoForwardUnconditionalNoti_t;
-
-typedef struct {
- unsigned int id;
-} TelCallInfoActiveNoti_t;
-
-typedef struct {
- unsigned int id;
-} TelCallInfoHeldNoti_t;
-
-typedef struct {
- unsigned int id;
-} TelCallInfoJoinedNoti_t;
-
-typedef struct {
- TelSoundPath_t path;
-} TelCallSoundPathNoti_t;
-
-typedef enum {
- TAPI_CALL_SOUND_RINGBACK_TONE_START,
- TAPI_CALL_SOUND_RINGBACK_TONE_END,
-} TelCallSoundRingbackToneNoti_t;
-
-typedef enum {
- TAPI_CALL_SOUND_WBAMR_STATUS_OFF,
- TAPI_CALL_SOUND_WBAMR_STATUS_ON,
-} TelCallSoundWbamrNoti_t;
-
-typedef struct {
- TelSoundNoiseReduction_t status;
-} TelCallSoundNoiseReductionNoti_t;
-
-typedef struct {
- TelSoundEqualizationMode_t mode;
- TelSoundDirection_t direction;
-} TelCallSoundEqualizationNoti_t;
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // _TEL_CALL_H_
-/**
- * @}
- */
+++ /dev/null
-/*
- * tel-plugin-dbus_tapi
- *
- * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * @ingroup TelephonyAPI
- * @addtogroup COMMON_TAPI COMMON
- * @{
- *
- * @file TelDefines.h
- * @brief This file provides #defines required for Telephony server and TAPI Client Library
- */
-
-#ifndef _TEL_DEFINES_H_
-#define _TEL_DEFINES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Machine independence */
-typedef long TS_INT32;
-typedef unsigned long TS_UINT32;
-
-typedef int TS_INT;
-typedef unsigned int TS_UINT;
-typedef double TS_DOUBLE;
-
-typedef int TS_BOOL;
-
-/* Programming concept */
-typedef unsigned char TS_BYTE;
-typedef unsigned short TS_WORD;
-typedef unsigned long TS_DWORD;
-typedef unsigned char TS_UINT8;
-typedef char TS_INT8;
-typedef unsigned short TS_UINT16;
-typedef unsigned long TS_ULONG;
-typedef unsigned long long TS_UINT64;
-typedef unsigned short TS_USHORT;
-
-#ifndef TRUE
-#define TRUE 1
-#endif
-
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-#ifndef DEPRECATED
-#define DEPRECATED __attribute__((deprecated))
-#endif
-
-typedef int HObj;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _TEL_DEFINES_H_ */
-
-/**
- * @}
- */
+++ /dev/null
-/*
- * tel-plugin-dbus_tapi
- *
- * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * @open
- * @ingroup TelephonyAPI
- * @addtogroup COMMON_TAPI COMMON
- * @{
- * These error codes are used by Applications.
- */
-
-
-#ifndef _TEL_ERR_H_
-#define _TEL_ERR_H_
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/************************************************************
-** Errors defined in "+CME ERROR" ,
-** - see 3GPP TS 27.007
-** - ranges are 0x00 ~ 0x7FFF
-************************************************************/
-/**
- Error codes sent by the modem in response to the above operations.
-*/
-typedef enum
-{
- /* GENERAL ERRORS */
- TAPI_OP_GEN_ERR_PHONE_FAILURE = 0, /* 0 */
- TAPI_OP_GEN_ERR_NO_CONNECTION_TO_PHONE, /* 1 */
- TAPI_OP_GEN_ERR_PHONE_ADAPTOR_LINK_RESERVED, /* 2 */
- TAPI_OP_GEN_ERR_OPER_NOT_ALLOWED, /* 3 */
- TAPI_OP_GEN_ERR_OPER_NOT_SUPPORTED, /* 4 */
- TAPI_OP_GEN_ERR_PH_SIM_PIN_REQU, /* 5 */
- TAPI_OP_GEN_ERR_PH_FSIM_PIN_REQU, /* 6 */
- TAPI_OP_GEN_ERR_PH_FSIM_PUK_REQU, /* 7 */
- TAPI_OP_GEN_ERR_SIM_NOT_INSERTED =10, /* 10 */
- TAPI_OP_GEN_ERR_SIM_PIN_REQU, /* 11 */
- TAPI_OP_GEN_ERR_SIM_PUK_REQU, /* 12 */
- TAPI_OP_GEN_ERR_SIM_FAILURE, /* 13 */
- TAPI_OP_GEN_ERR_SIM_BUSY, /* 14 */
- TAPI_OP_GEN_ERR_SIM_WRONG, /* 15 */
- TAPI_OP_GEN_ERR_INCORRECT_PW, /* 16 */
- TAPI_OP_GEN_ERR_SIM_PIN2_REQU, /* 17 */
- TAPI_OP_GEN_ERR_SIM_PUK2_REQU, /* 18 */
- TAPI_OP_GEN_ERR_MEM_FULL = 20, /* 20 */
- TAPI_OP_GEN_ERR_INVALID_INDEX, /* 21 */
- TAPI_OP_GEN_ERR_NOT_FOUND, /* 22 */
- TAPI_OP_GEN_ERR_MEM_FAILURE, /* 23 */
- TAPI_OP_GEN_ERR_TEXT_STR_TOO_LONG, /* 24 */
- TAPI_OP_GEN_ERR_INVALID_CHARACTERS_IN_TEXT_STR, /* 25 */
- TAPI_OP_GEN_ERR_DIAL_STR_TOO_LONG, /* 26 */
- TAPI_OP_GEN_ERR_INVALID_CHARACTERS_IN_DIAL_STR, /* 27 */
- TAPI_OP_GEN_ERR_NO_NET_SVC = 30, /* 30 */
- TAPI_OP_GEN_ERR_NET_TIMEOUT, /* 31 */
- TAPI_OP_GEN_ERR_NET_NOT_ALLOWED_EMERGENCY_CALLS_ONLY, /* 32 */
- TAPI_OP_GEN_ERR_NET_PERS_PIN_REQU = 40, /* 40 */
- TAPI_OP_GEN_ERR_NET_PERS_PUK_REQU, /* 41 */
- TAPI_OP_GEN_ERR_NET_SUBSET_PERS_PIN_REQU, /* 42 */
- TAPI_OP_GEN_ERR_NET_SUBSET_PERS_PUK_REQU, /* 43 */
- TAPI_OP_GEN_ERR_SVC_PROVIDER_PERS_PIN_REQU, /* 44 */
- TAPI_OP_GEN_ERR_SVC_PROVIDER_PERS_PUK_REQU, /* 45 */
- TAPI_OP_GEN_ERR_CORPORATE_PERS_PIN_REQU, /* 46 */
- TAPI_OP_GEN_ERR_CORPORATE_PERS_PUK_REQU, /* 47 */
- TAPI_OP_GEN_ERR_HIDDEN_KEY_REQU, /* 48 */
- TAPI_OP_GEN_ERR_UNKNOWN = 100, /* 100 */
-
- /* Errors related to a failure to perform an Attach */
- TAPI_OP_GEN_ERR_ILLEGAL_MS = 103, /* 103 */
- TAPI_OP_GEN_ERR_ILLEGAL_ME = 106, /* 106 */
- TAPI_OP_GEN_ERR_GPRS_SVC_NOT_ALLOWED, /* 107 */
- TAPI_OP_GEN_ERR_PLMN_NOT_ALLOWED = 111, /* 111 */
- TAPI_OP_GEN_ERR_LOCATION_AREA_NOT_ALLOWED, /* 112 */
- TAPI_OP_GEN_ERR_ROAMING_NOT_ALLOWED_IN_THIS_LOCATION_AREA,/* 113 */
-
- /* Errors related to a failure to Activate a Context */
- TAPI_OP_GEN_ERR_SVC_OPT_NOT_SUPPORTED = 132, /* 132 */
- TAPI_OP_GEN_ERR_REQ_SVC_OPT_NOT_SUBSCRIBED, /* 133 */
- TAPI_OP_GEN_ERR_SVC_OPT_TEMPORARILY_OUT_OF_ORDER, /* 134 */
- TAPI_OP_GEN_ERR_UNSPECIFIED_GPRS_ERR = 148, /* 148 */
- TAPI_OP_GEN_ERR_PDP_AUTHENTICATION_FAILURE, /* 149 */
- TAPI_OP_GEN_ERR_INVALID_MOBILE_CLASS, /* 150 */
-
- /* VBS / VGCS and eMLPP -related errors */
- TAPI_OP_GEN_ERR_VBS_VGCS_NOT_SUPPORTED_BY_THE_NET = 151, /* 151 */
- TAPI_OP_GEN_ERR_NO_SVC_SUBSCRIPTION_ON_SIM, /* 152 */
- TAPI_OP_GEN_ERR_NO_SUBSCRIPTION_FOR_GROUP_ID, /* 153 */
- TAPI_OP_GEN_ERR_GROUP_ID_NOT_ACTIVATED_ON_SIM, /* 154 */
- TAPI_OP_GEN_ERR_NO_MATCHING_NOTI = 155, /* 155 */
- TAPI_OP_GEN_ERR_VBS_VGCS_CALL_ALREADY_PRESENT, /* 156 */
- TAPI_OP_GEN_ERR_CONGESTION, /* 157 */
- TAPI_OP_GEN_ERR_NET_FAILURE, /* 158 */
- TAPI_OP_GEN_ERR_UPLINK_BUSY, /* 159 */
- TAPI_OP_GEN_ERR_NO_ACCESS_RIGHTS_FOR_SIM_FILE = 160, /* 160 */
- TAPI_OP_GEN_ERR_NO_SUBSCRIPTION_FOR_PRIORITY, /* 161 */
- TAPI_OP_GEN_ERR_OPER_NOT_APPLICABLE_OR_NOT_POSSIBLE, /* 162 */
-
-
- TAPI_OP_GEN_ERR_NONE = 0x8000, /* 0x8000 : No Errors */
-
- /* General Common Errors : 0x8000 - 0x80FF */
- TAPI_OP_GEN_ERR_INVALID_IPC, /* 0x8001 : Invalid IPC_GSM Parameter or Format */
- TAPI_OP_GEN_ERR_PHONE_OFFLINE, /* 0x8002 : */
- TAPI_OP_GEN_ERR_CMD_NOT_ALLOWED, /* 0x8003 : */
- TAPI_OP_GEN_ERR_PHONE_IS_INUSE, /* 0x8004 : */
- TAPI_OP_GEN_ERR_INVALID_STATE = 0x8005, /* 0x8005 : */
-
- TAPI_OP_GEN_ERR_NO_BUFFER, /* 0x8006 : No internal free buffers */
- TAPI_OP_GEN_ERR_OPER_REJ, /* 0x8007 : Operation Rejected */
- TAPI_OP_GEN_ERR_INSUFFICIENT_RESOURCE, /* 0x8008 : insufficient resource */
- TAPI_OP_GEN_ERR_NET_NOT_RESPOND, /* 0x8009 : Network not responding */
- TAPI_OP_GEN_ERR_SIM_PIN_ENABLE_REQ = 0x800A, /* 0x800A : SIM Pin Enable Required */
- TAPI_OP_GEN_ERR_SIM_PERM_BLOCKED, /* 0x800B : SIM Permanent Blocked */
- TAPI_OP_GEN_ERR_SIM_PHONEBOOK_RESTRICTED, /*0x800C: SIM Phonebook Restricted*/
- TAPI_OP_GEM_ERR_FIXED_DIALING_NUMBER_ONLY, /*0x800D: Restricted By FDN Mode */
-
- /* Reserved : 0x800E ~ 0x80FF */
- TAPI_OP_GEN_ERR_800E_RESERVED_START = 0x800E, /* 0x800E */
-
- TAPI_OP_GEN_ERR_80FF_RESERVED_END = 0x80ff, /* 0x80FF */
-
- /* the other errors */
- TAPI_OP_GEN_ERR_OTHERS = 0xFFFE, /* 0xFFFE */
-
- TAPI_OP_GEN_ERR_MAX = 0xFFFF
-
-}tapi_phone_err_t;
-
-typedef enum {
- TAPI_PDP_FAILURE_CAUSE_NORMAL = 0x00, // 0x00 : Normal Process ( no problem )
- TAPI_PDP_FAILURE_CAUSE_REL_BY_USER = 0x01, // Call Released by User
- TAPI_PDP_FAILURE_CAUSE_REGULAR_DEACTIVATION = 0x02, // Regular de-activation
- TAPI_PDP_FAILURE_CAUSE_LLC_SNDCP = 0x03, // LLC SNDCP failure
- TAPI_PDP_FAILURE_CAUSE_INSUFFICIENT_RESOURCE = 0x04, // Insufficient resources
- TAPI_PDP_FAILURE_CAUSE_UNKNOWN_APN = 0x05, // Missing or unknown APN
- TAPI_PDP_FAILURE_CAUSE_UNKNOWN_PDP_ADDRESS = 0x06, // Unknown PDP address or type
- TAPI_PDP_FAILURE_CAUSE_USER_AUTH_FAILED = 0x07, // Unknown PDP address or type
- TAPI_PDP_FAILURE_CAUSE_ACT_REJ_GGSN = 0x08, // Unknown PDP address or type
- TAPI_PDP_FAILURE_CAUSE_ACT_REJ_UNSPECIFIED = 0x09, // Unknown PDP address or type
- TAPI_PDP_FAILURE_CAUSE_SVC_OPTION_NOT_SUPPORTED = 0x0A, // Service option not supported
- TAPI_PDP_FAILURE_CAUSE_SVC_NOT_SUBSCRIBED = 0x0B, // Requested service option not subscribed
- TAPI_PDP_FAILURE_CAUSE_SVC_OPT_OUT_ORDER = 0x0C, // Service out of order
- TAPI_PDP_FAILURE_CAUSE_NSAPI_USED = 0x0D, // NSAPI already used
- TAPI_PDP_FAILURE_CAUSE_QOS_NOT_ACCEPTED = 0x0E, // QoS not accepted
- TAPI_PDP_FAILURE_CAUSE_NETWORK_FAILURE = 0x0F, // Network Failure
- TAPI_PDP_FAILURE_CAUSE_REACT_REQUIRED = 0x10, // Reactivation Required
- TAPI_PDP_FAILURE_CAUSE_FEATURE_NOT_SUPPORTED = 0x11, // Feature not supported
- TAPI_PDP_FAILURE_CAUSE_TFT_FILTER_ERROR = 0x12, // TFT or filter error
- TAPI_PDP_FAILURE_CAUSE_UNKOWN_PDP_CONTEXT = 0x13, // Unknown PDP context
- TAPI_PDP_FAILURE_CAUSE_INVALID_MSG = 0x14, // Invalid MSG
- TAPI_PDP_FAILURE_CAUSE_PROTOCOL_ERROR = 0x15, // Protocol error
- TAPI_PDP_FAILURE_CAUSE_MOBILE_FAILURE_ERROR = 0x16, // Mobile failure error
- TAPI_PDP_FAILURE_CAUSE_TIMEOUT_ERROR = 0x17, // Timeout error
- TAPI_PDP_FAILURE_CAUSE_UNKNOWN_ERROR = 0x18, // Unknown error
- TAPI_PDP_FAILURE_CAUSE_MAX ,
-} tapi_pdp_err_t;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // _TEL_ERR_H_
-
-/**
-* @}
-*/
+++ /dev/null
-/*
- * tel-plugin-dbus_tapi
- *
- * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
-* @open
-* @ingroup TelephonyAPI
-* @addtogroup SAT_TAPI SAT
-* @{
-*
-* @file TelSat.h
-
- @brief This file serves as a "C" header file defines structures for Telephony SAT Services. \n
- It contains a sample set of constants, enums, structs that would be required by applications.
-
-
- */
-
-#ifndef _TEL_SAT_H_
-#define _TEL_SAT_H_
-
-#include <TelDefines.h>
-#include <TelCall.h>
-#include <TelSs.h>
-#include <TelSatObj.h>
-#include <TelSatProactvCmd.h>
-#include <TelSatEnvelope.h>
-#include <TelSim.h>
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-#define TAPI_SAT_DEF_TITLE_LEN_MAX 50 /**< max length for Menu Title */
-#define TAPI_SAT_DEF_ITEM_STR_LEN_MAX 50 /**< max length for Menu Item */
-#define TAPI_SAT_DEF_TEXT_STRING_LEN_MAX 500 /**< max length for Text String */
-#define TAPI_SAT_DEF_BIT_MASK_CONTACT 0x01 /**< Bit Mask for Contact */
-#define TAPI_SAT_DEF_BIT_MASK_MSG 0x02 /**< Bit Mask for Msg */
-#define TAPI_SAT_DEF_BIT_MASK_OTHER 0x04 /**< Bit Mask for Psh */
-#define TAPI_SAT_REFRESH_FILE_LIST 20 /**< Refresh File List*/
-#define TAPI_SAT_DEF_SS_LEN_MAX 250
-#define TAPI_SAT_DEF_USSD_LEN_MAX 250
-
-// Telephony UI USER CONFIRM TYPE
-/**
- * @enum TelSatUiUserConfirmType_t
- * This enumeration defines the UI User Confirm Type.
- */
-typedef enum
-{
- TAPI_SAT_USER_CONFIRM_YES, /**<This Enum Informs That user confirms yes */
- TAPI_SAT_USER_CONFIRM_NO_OR_CANCEL, /**<This enum informs that user confirms no/cancel */
- TAPI_SAT_USER_CONFIRM_HELP_INFO, /**<This enum informs that user wants help information */
- TAPI_SAT_USER_CONFIRM_END, /**<This enum informs that user confirms end */
- TAPI_SAT_USER_CONFIRM_TIMEOUT, /**<This enum informs that user did not respond */
-}TelSatUiUserConfirmType_t;
-
-// Telephony UI INKEY TYPE
-/**
- * @enum TelSatUiInkeyYesNoCaseType_t
- * This enumeration defines the UI Inkey Type Yes or No.
- */
-typedef enum
-{
- TAPI_SAT_INKEY_CONFIRM_NO = 0x00, /**<No*/
- TAPI_SAT_INKEY_CONFIRM_YES = 0x01, /**<Yes*/
-}TelSatUiInkeyYesNoCaseType_t;
-
-// Telephony UI DISPLAY STATUS
-/**
- * @enum TelSatUiDisplayStatusType_t
- * This enumeration defines the UI Display Status.
- */
-typedef enum
-{
- TAPI_SAT_DISPLAY_SUCCESS = 0x00, /**<This enum informs UI display success*/
- TAPI_SAT_DISPLAY_FAIL = 0x01, /**<This enum informs UI display failure*/
-}TelSatUiDisplayStatusType_t;
-
-// TELEPHONY REFRESH APPLICATION TYPE
-/**
- * @enum TelSatRefreshAppType_t
- * This enumeration defines the Refresh Application Type.
- */
- typedef enum
-{
- TAPI_SAT_REFRESH_CONTACT = 0x00, /**<refresh application type - Phonebook*/
- TAPI_SAT_REFRESH_MSG, /**<refresh application type - SMS*/
- TAPI_SAT_REFRESH_OTHER, /**<refresh application type - other*/
- TAPI_SAT_REFRESH_MAX, /**<Maximum Enumeration Value*/
-}TelSatRefreshAppType_t;
-
-// Telephony COMMAND PERFORMED RESULT
-/**
- * @enum TelSatCommandPerformResultType_t
- * This enumeration defines the Result of Proactive Command execution.
- */
-typedef enum
-{
- TAPI_SAT_CMD_PERFORM_SUCCESS = 0x00, /**<command performed successfully*/
- TAPI_SAT_CMD_PERFORM_FAIL, /**<command execution failed*/
- TAPI_SAT_CMD_PERFORM_MAX, /**<Maximum Enumeration Value*/
-}TelSatCommandPerformResultType_t;
-
-// Telephony CALL CONTROL TYPE
-/**
- * @enum TelSatCallCtrlType_t
- * This enumeration defines Call Control Type.
- */
-typedef enum
-{
- TAPI_SAT_CALL_CNF_NONE = 0x00, /**<call control confirm type - None*/
- TAPI_SAT_CALL_CNF_CALL, /**<call control confirm type - call*/
- TAPI_SAT_CALL_CNF_SS, /**<call control confirm type - ss*/
- TAPI_SAT_CALL_CNF_USSD, /**<call control confirm type - ussd*/
- TAPI_SAT_CALL_CNF_MAX, /**<Maximum Enumeration Value*/
-}TelSatCallCtrlType_t;
-
-// SAT UI USER CONFIRMATION INFO
-/**
- * This structure defines the user confirmation data.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- TelSatCommandType_t commandType; /**<Proactive Command Type*/
- TelSatUiUserConfirmType_t keyType; /**<User Response Type*/
- unsigned char* pAdditionalData; /**<Additional Data*/
- int dataLen; /**<Additional Data Length*/
-}TelSatUiUserConfirmInfo_t;
-
-// Telephony TEXT INFO
-/**
- * This structure defines the character data for sat engine data structure.
- */
-typedef struct
-{
- unsigned short stringLen; /**<character data length*/
- unsigned char string[TAPI_SAT_DEF_TEXT_STRING_LEN_MAX+1]; /**<character data*/
-}TelSatTextInfo_t;
-
-// Telephony MAIN MENU TITLE INFO
-/**
- * This structure defines the main menu title to check sat menu.
- */
-typedef struct
-{
- int bIsMainMenuPresent; /**<flag to check sat main menu existence*/
- TelSatTextInfo_t mainMenuTitle; /**<main menu title data*/
-}TelSatMainMenuTitleInfo_t;
-
-// Telephony DISPLAY TEXT DATA
-/**
- * This structure defines the display text proactive command for sat ui.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- TelSatTextInfo_t text; /**<character data to display on screen*/
- unsigned int duration; /**<the duration of display */
- int bIsPriorityHigh; /**<indicates whether the text is to be displayed if some other app is using the screen.*/
- int bIsUserRespRequired; /**<indicates whether user response required or Not*/
- int b_immediately_resp;
- TelSatIconIdentifierInfo_t iconId; /**< Icon Identifier */
-}TelSatDisplayTextInd_t;
-
-// Telephony INKEY DATA
-/**
- * This structure defines the get inkey proactive command data for sat ui.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- TelSatInkeyType_t keyType; /**<input Type:Character Set or Yes/No*/
- TelSatUseInputAlphabetType_t inputCharMode; /**<input character mode(SMS default, UCS2)*/
- int bIsNumeric; /**<is input character numeric(0-9, *, # and +)*/
- int bIsHelpInfoAvailable; /**<help info request flag*/
- TelSatTextInfo_t text; /**<character data to display on screen*/
- unsigned int duration; /**<the duration of display*/
- TelSatIconIdentifierInfo_t iconId; /**<Icon Identifier*/
-}TelSatGetInkeyInd_t;
-
-// Telephony GET INPUT DATA
-/**
- * This structure defines the get input proactive command data for sat ui.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- TelSatUseInputAlphabetType_t inputCharMode; /**<input character mode(SMS default, UCS2)*/
- int bIsNumeric; /**<is input character numeric(0-9, *, # and +)*/
- int bIsHelpInfoAvailable; /**<flag for help info request */
- int bIsEchoInput; /**<indicates whether to show input data on screen or not*/
- TelSatTextInfo_t text; /**<character data to display on screen*/
- TelSatRespLenInfo_t respLen; /**<input data min, max length*/
- TelSatTextInfo_t defaultText; /**<default input character data*/
- TelSatIconIdentifierInfo_t iconId; /**<Icon Identifier*/
-}TelSatGetInputInd_t;
-
-// Telephony PLAY TONE DATA
-/**
- * This structure defines the play tone proactive command data for application.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- TelSatTextInfo_t text; /**<character data to display on screen*/
- TelSatToneInfo_t tone; /**<tone info */
- unsigned int duration; /**<the duration for playing tone*/
- TelSatIconIdentifierInfo_t iconId; /**<Icon Identifier*/
-}TelSatPlayToneInd_t;
-
-// Telephony UI info
-/**
- * This structure defines the data for sat ui.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- int user_confirm;
- TelSatTextInfo_t text; /**<character data to display on screen*/
- TelSatIconIdentifierInfo_t iconId; /**<Icon Identifier*/
-}TelSatSendUiInfo_t;
-
-// Telephony MENU ITEM DATA FOR SETUP MENU
-/**
- * This structure defines the menu item info for setup menu.
- */
-typedef struct
-{
- char itemString[TAPI_SAT_DEF_ITEM_STR_LEN_MAX + 6]; /**<menu item character data*/
- char itemId; /**<identifies the item on the menu that user selected*/
-}TelSatMenuInfo_t;
-
-// Telephony SETUP MENU INFO
-/**
- * This structure defines the sat main menu info.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- int bIsMainMenuPresent;
- char satMainTitle[TAPI_SAT_DEF_TITLE_LEN_MAX + 1]; /**<menu title text*/
- TelSatMenuInfo_t satMainMenuItem[TAPI_SAT_MENU_ITEM_COUNT_MAX]; /**< menu items*/
- unsigned short satMainMenuNum; /**<number of menu items*/
- int bIsSatMainMenuHelpInfo; /**<flag for help information request */
- int bIsUpdatedSatMainMenu;
- TelSatIconIdentifierInfo_t iconId; /**<Icon Identifier*/
- TelSatIconIdentifierListInfo_t iconIdList; /**<List of Icon Identifiers*/
-}TelSatSetupMenuInfo_t;
-
-// Telephony SELECT ITEM DATA
-/**
- * This structure defines the select item proactive command data for sat ui.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- int bIsHelpInfoAvailable; /**<flag for help information request*/
- TelSatTextInfo_t text; /**<menu title text*/
- char defaultItemIndex; /**<selected default item - default value is 0*/
- char menuItemCount; /**<number of menu items*/
- TelSatMenuItemInfo_t menuItem[TAPI_SAT_MENU_ITEM_COUNT_MAX]; /**<menu items*/
- TelSatIconIdentifierInfo_t iconId; /**<Icon Identifier*/
- TelSatIconIdentifierListInfo_t iconIdList; /**<List of Icon Identifiers*/
-
-}TelSatSelectItemInd_t;
-
-// Telephony IDLE MODE TEXT DATA
-/**
- * This structure defines the setup idle mode text proactive command for idle application.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- TelSatTextInfo_t text; /**<character data to display on screen*/
- TelSatIconIdentifierInfo_t iconId;
-} TelSatSetupIdleModeTextInd_t;
-
-// Telephony REFRESH DATA
-/**
- * This structure defines the refresh proactive command data for sat ui.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- unsigned int duration; /**<the duration of display*/
- TelSatCmdQualiRefresh_t refreshType; /**<refresh mode*/
-}TelSatRefreshIndUiInfo_t;
-
-// Telephony REFRESH DATA
-/**
- * This structure defines the refresh proactive command data for applications which are concerned with files resident on USIM .
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- TelSatRefreshAppType_t appType; /**<concerned application type */
- TelSatCmdQualiRefresh_t refreshMode; /**<refresh mode*/
- unsigned char fileCount; /**<refresh file count*/
- TelSimFileID_t fileId[TAPI_SAT_REFRESH_FILE_LIST]; /**<refresh file identifier*/
-}TelSatRefreshInd_t;
-
-// Telephony END PROACTIVE COMMAND INFO
-/**
- * This structure defines the data objects to indicate to sat ui, the end of execution of a specific proactive command by other application.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- char commandType; /**< Command Type*/
- TelSatCommandPerformResultType_t result; /**<result of command execution by application*/
-}TelSatProactiveCmdEndIndInfo_t;
-
-// Telephony SEND SMS DATA
-/**
- * This structure defines the send sms proactive command data for sms application.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- int bIsPackingRequired; /**<flag to check if packing required for sms tpdu*/
- TelSatAddressInfo_t address; /**<destination address*/
- TelSatSmsTpduInfo_t smsTpdu; /**<SMS TPDU data*/
-} TelSatSendSmsIndSmsData_t;
-
-// Telephony SEND SS DATA
-/**
- * This structure defines the send ss proactive command data for ss application.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- TelSimTypeOfNum_t ton; /**< type of number */
- TelSimNumberingPlanIdentity_t npi; /**< number plan identity */
- unsigned short ssStringLen;
- unsigned char ssString[TAPI_SAT_DEF_SS_LEN_MAX+1];
-}TelSatSendSsIndSsData_t;
-
-// Telephony USSD DATA
-/**
- * This structure defines the send ussd proactive command data for ussd application.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- unsigned char rawDcs; /**<data coding scheme*/
- unsigned short ussdStringLen;
- unsigned char ussdString[TAPI_SAT_DEF_USSD_LEN_MAX+1];
-}TelSatSendUssdIndUssdData_t;
-
-// Telephony SEND DTMF DATA
-/**
- * This structure defines the send dtmf proactive command data for dtmf application.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- int bIsHiddenMode; /**<hidden mode flag*/
- TelSatTextInfo_t dtmfString; /**<dtmf string data*/
-}TelSatSendDtmfIndDtmfData_t;
-
-// Telephony SETUP CALL DATA
-/**
- * This structure defines the setup call proactive command data for call application.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- TelSatCmdQualiSetupCall_t calltype; /**<call type*/
- TelSatTextInfo_t dispText; /**<display data for calling*/
- TelSatTextInfo_t callNumber; /**<call number*/
- unsigned int duration; /**<maximum repeat duration*/
- TelSatIconIdentifierInfo_t iconId; /**<icon identifier for call application*/
-}TelSatSetupCallIndCallData_t;
-
-// Telephony LAUNCH BROWSER DATA
-/**
- * This structure defines the launch browser proactive command data for browser application.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- TelSatUrlInfo_t url; /**<url to connect*/
- TelSatCmdQualiLaunchBrowser_t launchType; /**<launch type*/
- TelSatBrowserIdentityType_t IdentityType; /**<Browser Identity -default, html, etc*/
-}TelSatLaunchBrowserIndBrowserData_t;
-
-// Telephony PROVIDE LOCAL INFO DATA
-/**
- * This structure defines the provide local info proactive command data for application.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- TelSatCmdQualiProvideLocalInfo_t localInfoType; /**<Provide Local Information Type*/
-}TelSatProvideLocalInfoInd_t;
-
-// Telephony LANGUAGE NOTIFICATION DATA
-/**
- * This structure defines the language notification proactive command data for application.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- int bSpecificLanguageNotification; /**<flag for checking specific language notification. if FALSE, non-specific language notification */
- TelSatLanguageInfo_t language; /**<language info from USIM application */
-}TelSatLanguageNotiInfoInd_t;
-
-// Telephony PLAY TONE RETURN INFO
-/**
- * This structure defines the return result data for Play Tone proactive command.
- */
-typedef struct
-{
- TelSatResultType_t resp; /**<result response value*/
-}TelSatSetupMenuRetInfo_t;
-
-// Telephony REFRESH RETURN INFO
-/**
- * This structure defines the return result data for refresh proactive command.
- */
-typedef struct
-{
- TelSatRefreshAppType_t appType; /**<application type*/
- TelSatResultType_t resp; /**<result response value*/
-}TelSatRefreshRetInfo_t;
-
-// Telephony CALL RETURN INFO
-/**
- * This structure defines the return result data for setup call proactive command.
- */
-typedef struct
-{
- TelSatResultType_t resp; /**<result response value*/
- int bIsTapiCauseExist; /**<flag for checking tapi error cause */
- TelCallCause_t tapiCause; /**<tapi call error cause*/
- TelSsCause_t ssCause; /**<tapi ss error cause*/
- TelSatMeProblemType_t meProblem; /**<me problem error cause*/
- int bIsOtherInfoExist; /**<call control result existence flag*/
- TelSatCallCtrlProblemType_t permanentCallCtrlProblem; /**<call control problem type*/
- TelSatCallCtrlRequestedActionInfo_t callCtrlRequestedAction; /**<call control request data*/
- TelSatResultInfo_t result2; /**<call control envelope result value*/
- TelSatTextTypeInfo_t text; /**<call control envelope display data*/
-}TelSatCallRetInfo_t;
-
-// Telephony SS RETURN INFO
-/**
- * This structure defines the return result data for send ss proactive command.
- */
-typedef struct
-{
- TelSatResultType_t resp; /**<result response value*/
- TelSsCause_t ssCause; /**<error - ss cause*/
- TelSatTextInfo_t ssString; /**<ss result string*/
- TelSatMeProblemType_t meProblem; /**<error - me problem*/
- int bIsOtherInfoExist; /**<call control result exist flag*/
- TelSatCallCtrlProblemType_t additionalCallCtrlProblemInfo; /**<call control problem*/
- TelSatCallCtrlRequestedActionInfo_t callCtrlRequestedAction; /**<call control request data*/
- TelSatResultInfo_t result2; /**<call control envelope result value*/
-}TelSatSsRetInfo_t;
-
-// Telephony USSD RETURN INFO
-/**
- * This structure defines the return result data for send ussd proactive command.
- */
-typedef struct
-{
- TelSatResultType_t resp; /**<result response value*/
- TelSsCause_t ssCause; /**<error - ss cause*/
- TelSatTextInfo_t ussdString; /**<ussd result string*/
- TelSatDataCodingSchemeInfo_t dcsUssdString; /**<dcs of ussd result string */
- TelSatMeProblemType_t meProblem; /**<error - me problem*/
- int bIsOtherInfoExist; /**<call control result exist flag*/
- TelSatCallCtrlProblemType_t additionalCallCtrlProblemInfo; /**<call control problem*/
- int bCallCtrlHasModification; /**<call control request modification flag*/
- TelSatCallCtrlRequestedActionInfo_t callCtrlRequestedAction; /**<call control request data*/
- TelSatResultInfo_t result2; /**<call control envelope result value*/
- TelSatTextTypeInfo_t text2; /**<cc envelope display data */
-}TelSatUssdRetInfo_t;
-
-// Telephony SMS RETURN INFO
-/**
- * This structure defines the return result data for send sms proactive command.
- */
-typedef struct
-{
- TelSatResultType_t resp; /**<result response value*/
-}TelSatSmsRetInfo_t;
-
-// Telephony DTMF RETUEN INFO
-/**
- * This structure defines the return result data for send dtmf proactive command.
- */
-typedef struct
-{
- TelSatResultType_t resp; /**<result response value*/
-}TelSatDtmfRetInfo_t;
-
-// Telephony BROWSER RETURN INFO
-/**
- * This structure defines the return result data for launch browser proactive command.
- */
-typedef struct
-{
- TelSatResultType_t resp; /**<result response value*/
- TelSatLaunchBrowserProblemType_t browserProblem; /**<specific browser problem*/
-}TelSatBrowserRetInfo_t;
-
-// Telephony SETUP IDLE MODE TEXT RETURN INFO
-/**
- * This structure defines the return result data for setup idle mode text proactive command.
- */
-typedef struct
-{
- TelSatResultType_t resp; /**<result response value*/
-}TelSatIdleTextRetInfo_t;
-
-// Telephony PLAY TONE RETURN INFO
-/**
- * This structure defines the return result data for Play Tone proactive command.
- */
-typedef struct
-{
- TelSatResultType_t resp; /**<result response value*/
-}TelSatPlayToneRetInfo_t;
-
-// Telephony PROVIDE LOCAL INFO RETURN INFO
-/**
- * This structure defines the return result data for setup idle mode text proactive command.
- */
-typedef struct
-{
- TelSatResultType_t resp; /**<result response value*/
- int bOtherInfo; /**<flag to check whether other information are required or not */
- TelSatCmdQualiProvideLocalInfo_t infoType; /**<local info type - e.g. time zone or language info, etc */
- union
- {
- TelSatDataTimeZoneInfo_t timeZoneInfo; /**< current time zone info */
- TelSatLanguageInfo_t languageInfo; /**< current ME language setting info */
- }u; /**< Union*/
-}TelSatProvideLocalRetInfo_t;
-
-// Telephony LANGUAGE NOTI RETURN INFO
-/**
- * This structure defines the return result data for setup idle mode text proactive command.
- */
-typedef struct
- {
- TelSatResultType_t resp; /**<result response value*/
- }TelSatLanguageNotiRetInfo_t;
-
-// Telephony DISPLAY TEXT RETURN INFO
-/**
- * This structure defines the return result data for setup idle mode text proactive command.
- */
-typedef struct
- {
- TelSatResultType_t resp; /**<result response value*/
- TelSatMeProblemType_t meProblem; /**<Me Problem Type */
- }TelSatDiplayTextRetInfo_t;
-
-// Telephony APPLICATIONS RETURN DATA
-/**
- * This structure defines the common return result data for applications proactive command.
- */
-typedef struct
-{
- TelSatCommandType_t commandType; /**<Proactive Command type*/
- int commandId; /**<Proactive Command Number sent by USIM*/
- union
- {
- TelSatSetupMenuRetInfo_t setupMenu; /**<result response value for setup menu*/
- TelSatRefreshRetInfo_t refresh; /**<result response value for refresh*/
- TelSatCallRetInfo_t setupCall; /**<result response value for setup call*/
- TelSatSsRetInfo_t sendSs; /**<result response value for send ss*/
- TelSatUssdRetInfo_t sendUssd; /**<result response value for send ussd*/
- TelSatSmsRetInfo_t sendSms; /**<result response value for send sms*/
- TelSatDtmfRetInfo_t sendDtmf; /**<result response value for send dtmf*/
- TelSatBrowserRetInfo_t launchBrowser; /**<result response value for launch browser*/
- TelSatIdleTextRetInfo_t setupIdleModeText; /**<result response value for setup idle mode text*/
- TelSatLanguageNotiRetInfo_t languageNoti; /**<result response value for language notification*/
- TelSatProvideLocalRetInfo_t provideLocalInfo; /**<result response value for provide local info*/
- TelSatDiplayTextRetInfo_t displayText; /**<result response value for dsiplay text*/
- TelSatPlayToneRetInfo_t playTone; /**<result response value for play tone*/
- }appsRet; /**< common union result value */
-}TelSatAppsRetInfo_t;
-
-// Telephony CALL CONTROL CONFIRM DATA FOR CALL
-/**
- * This structure defines the call control confirm data for call.
- */
-typedef struct
-{
- TelSatTextInfo_t address; /**< call destination address*/
- TelSatTextInfo_t subAddress; /**< call SUB address*/
- TelSatBcRepeatIndicatorType_t bcRepeatIndicator; /**< bc repeat indicator*/
- TelSatTextInfo_t ccp1; /**< Configuration Capability Parameter 1*/
- TelSatTextInfo_t ccp2; /**< Configuration Capability Parameter 2*/
-} TelSatCallCtrlIndCallData_t;
-
-// Telephony CALL CONTROL CONFIRM DATA FOR SS
-/**
- * This structure defines the call control confirm data for ss.
- */
-typedef struct
-{
- TelSatTextInfo_t ssString; /**< ss destination address*/
- TelSatTextInfo_t subAddress; /**< call SUB address*/
- TelSatBcRepeatIndicatorType_t bcRepeatIndicator; /**< bc repeat indicator*/
- TelSatTextInfo_t ccp1; /**< Configuration Capability Parameter 1*/
- TelSatTextInfo_t ccp2; /**< Configuration Capability Parameter 2*/
-} TelSatCallCtrlIndSsData_t;
-
-// Telephony CALL CONTROL CONFIRM DATA FOR USSD
-/**
- * This structure defines the call control confirm data for ussd.
- */
-typedef struct
-{
- TelSatTextInfo_t ussdString; /**< ussd destination address*/
-} TelSatCallCtrlIndUssdData_t;
-
-// Telephony READ FILE REQUEST DATA
-/**
- * This structure defines the common call control confirm data.
- */
-typedef struct
-{
- TelSatCallType_t callCtrlCnfType; /**<call control confirm type - call, ss or ussd*/
- TelSatCallCtrlResultType_t callCtrlResult; /**<call control result*/
- TelSatTextInfo_t dispData; /**<call control display data*/
- int bIsUserInfoDisplayEnabled; /**<flag for checking existence of call control display */
-
- union
- {
- TelSatCallCtrlIndCallData_t callCtrlCnfCallData; /**<call control call address*/
- TelSatCallCtrlIndSsData_t callCtrlCnfSsData; /**<call control ss string*/
- TelSatCallCtrlIndUssdData_t callCtrlCnfUssdData; /**<call control ussd string*/
- }u; /**< Union*/
-} TelSatCallCtrlIndData_t;
-
-// Telephony MO SMS CONTROL CONFIRMATION DATA
-/**
- * This structure defines the mo sms control confirm data.
- */
-typedef struct
-{
- TelSatCallCtrlResultType_t moSmsCtrlResult; /**<envelope result*/
- int bIsUserInfoDisplayEnabled; /**<display present flag*/
- TelSatTextTypeInfo_t dispData; /**<display data for sending SMS*/
- TelSatTextTypeInfo_t rpDestAddr; /**<the RP_Destination_Address of the Service Center */
- TelSatTextTypeInfo_t tpDestAddr; /**<the TP_Destination_Address */
-} TelSatMoSmCtrlIndData_t;
-
-// Telephony EVENT LIST INFO
-/**
- * This structure defines the Event List Info.
- */
-typedef struct
-{
- int bIsEventDownloadActive; /**<Is Event Download Active*/
- int bIsMtCallEvent; /**<Is Mt Call Event*/
- int bIsCallConnected; /**<Is Call Connected*/
- int bIsCallDisconnected; /**<Is Call Disconnected*/
- int bIsLocationStatus; /**<Is Location Status*/
- int bIsUserActivity; /**<Is User Activity*/
- int bIsIdleScreenAvailable; /**<Is Idle Screen Available*/
- int bIsCardReaderStatus; /**<Is Card Reader Status*/
- int bIsLanguageSelection; /**<Is Language Selection*/
- int bIsBrowserTermination; /**<Is Browser Termination*/
- int bIsDataAvailable; /**<Is Data Available*/
- int bIsChannelStatus; /**<Is Channel Status*/
-} TelSatEventListData_t;
-
-/**
- * This is the structure to be used by the Application to send envelope/event download data.
- * This contains the data structures to be used to send any envelope/event download data.
- */
-typedef struct
-{
- TelSatEventDownloadType_t eventDownloadType; /**< eventDownload Type */
-
- union
- {
- int bIdleScreenAvailable; /**<flag to specify whether Idle Screen is Available or not*/
- TelSatLanguageSelectionEventReqInfo_t languageSelectionEventReqInfo; /**<Selected Language Information*/
- TelSatBrowserTerminationEventReqInfo_t browserTerminationEventReqInfo; /**<BrowserTermination Event Information */
- TelSatDataAvailableEventReqInfo_t dataAvailableEventReqInfo; /**<dataAvailableEventReqInfo */
- TelSatChannelStatusEventReqInfo_t channelStatusEventReqInfo; /**<channelStatusEventReqInfo */
- } u; /**<Union*/
-} TelSatEventDownloadReqInfo_t;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _TEL_SAT_H_ */
-
-/**
-* @}
-*/
+++ /dev/null
-/*
- * tel-plugin-dbus_tapi
- *
- * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
-* @open
-* @ingroup TelephonyAPI
-* @addtogroup SAT_TAPI SAT
-* @{
-*
-* @file TelSatEnvelope.h
-
- @brief This file serves as a "C" header file defines structures for Tapi Sat envelope command Services. \n
- It contains a sample set of constants, enums, structs that would be required by applications.
- */
-
-#ifndef _TEL_SAT_ENVELOPE_H_
-#define _TEL_SAT_ENVELOPE_H_
-
-#include <TelSatObj.h>
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/**
- * @enum TelSatCallType_t
- * This enum indicates the SAT call type
- */
-typedef enum
-{
- TAPI_SAT_CALL_TYPE_MO_VOICE = 0X00, /**< call type - mo voice */
- TAPI_SAT_CALL_TYPE_MO_SMS, /**< call type - mo sms */
- TAPI_SAT_CALL_TYPE_SS, /**< call type - ss */
- TAPI_SAT_CALL_TYPE_USSD, /**< call type - ussd */
- TAPI_SAT_PDP_CNTXT_ACT, /**< call type - pdp context action */
- TAPI_SAT_CALL_TYPE_MAX /**< call type - max */
-}TelSatCallType_t;
-
-/**
- * @enum TelSatCallCtrlResultType_t
- * This enum indicates the result of call control by SIM.
- */
-typedef enum
-{
- TAPI_SAT_CALL_CTRL_R_ALLOWED_NO_MOD = 0, /**< call control result type - ALLOWED WITH NO MOD */
- TAPI_SAT_CALL_CTRL_R_NOT_ALLOWED = 1, /**< call control result type - NOT ALLOWED */
- TAPI_SAT_CALL_CTRL_R_ALLOWED_WITH_MOD = 2, /**< call control result type - ALLOWED WITH MOD */
- TAPI_SAT_CALL_CTRL_R_RESERVED = 0xFF /**< call control result type - RESERVED */
-
-} TelSatCallCtrlResultType_t;
-
-/**
- * @enum TelSatEnvelopeResp_t
- * This enum indicates the general result of sending an envelope command to USIM.
- */
-typedef enum
-{
- TAPI_SAT_ENVELOPE_SUCCESS, /**< envelope result - success */
- TAPI_SAT_ENVELOPE_SIM_BUSY, /**< envelope result - USIM busy */
- TAPI_SAT_ENVELOPE_FAILED /**< envelope result - failed */
-
-}TelSatEnvelopeResp_t;
-
-// 8. MENU SELECTION
-/**
- * This structure contains the data objects for MENU SELECTION envelope.
- */
-typedef struct
-{
- unsigned char itemIdentifier; /**< menu selection item identifier */
- int bIsHelpRequested; /**< flag to check whether help information required or not */
-} TelSatMenuSelectionReqInfo_t;
-
-// 9.1 CALL CONTROL BY SIM
-/**
- * This struct contains the data objects for Call Control result data sent by USIM.
- */
-typedef struct
-{
- TelSatAddressInfo_t address; /**< call number */
- TelSatSubAddressInfo_t subAddress; /**< call number sub address */
- TelSatBcRepeatIndicatorType_t bcRepeatIndicator; /**< bc repeat indicator */
- TelSatCapaConfigParamInfo_t ccp1; /**< capability configuration parameter1 */
- TelSatCapaConfigParamInfo_t ccp2; /**< capability configuration parameter2 */
-}TelSatVoiceCallCtrlIndInfo_t;
-
-/**
- * This struct contains SAT ss control result data sent by USIM.
- */
-typedef struct
-{
- TelSatSsStringInfo_t ssString; /**< ss number */
- TelSatSubAddressInfo_t subAddress; /**< ss sub address */
- TelSatBcRepeatIndicatorType_t bcRepeatIndicator; /**< bc repeat indicator */
- TelSatCapaConfigParamInfo_t ccp1; /**< capability configuration parameter1 */
- TelSatCapaConfigParamInfo_t ccp2; /**< capability configuration parameter2 */
-}TelSatSsCtrlIndInfo_t;
-
-/**
- * This struct contains SAT mo SMS control configuration data
- */
-typedef struct
-{
- TelSatAddressInfo_t rpDestAddress; /**< sms control rp destination address */
- TelSatAddressInfo_t tpDestAddress; /**< sms control tp destination address */
-} TelSatMoSmsCtrlIndInfo_t;
-
-/**
- * This struct contains SAT call control configuration data
- */
-typedef struct
-{
- TelSatCallType_t callType; /**< call type */
- TelSatCallCtrlResultType_t callCtrlResult; /**< call control result */
- TelSatAlphaIdentifierInfo_t alphaIdentifier;/**< alpha identifier */
- unsigned char callId; /**< call id */
- TelSatCallType_t oldCallType; /**< old call type */
- union
- {
- TelSatVoiceCallCtrlIndInfo_t voiceCallData; /**< voice call control data */
- TelSatSsCtrlIndInfo_t ssData; /**< ss control data */
- TelSatMoSmsCtrlIndInfo_t smsData;
- }u; /**< Union */
-} TelSatCallCtrlIndInfo_t;
-
-// 9.2 MO SHORT MESSAGE CONTROL BY SIM RESULT
-/**
- * This struct contains SAT mo ss control request data
- */
- typedef struct
-{
- TelSatCallCtrlResultType_t callCtrlResult; /**< call control result */
- TelSatAlphaIdentifierInfo_t alphaIdentifier; /**< alpha identifier */
- TelSatMoSmsCtrlIndInfo_t smsData; /**< sms control data */
-}TelSatMoSMCtrlResult_t;
-
-// 11.5 EVENT DOWNLOAD - USER ACTIVITY EVENT
-/**
- * This struct contains SAT user activity event request data
- */
-typedef struct
-{
- TelSatEventListInfo_t eventList; /**< event List */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info */
-
-} TelSatUserActivityEventReqInfo_t;
-
-// 11.6 EVENT DOWNLOAD - IDLE SCREEN AVAILABLE EVENT
-/**
- * This structure contains the data objects for IDLE SCREEN AVAILABLE event download.
- */
-typedef struct
-{
- TelSatEventDownloadType_t eventData; /**< event type */
-} TelSatIdleScreenAvailableEventReqInfo_t;
-
-// 11.8 EVENT DOWNLOAD - LANGUAGE SELECTION EVENT
-/**
- * This structure contains the data objects for LANGUAGE SELECTION event download.
- */
-typedef struct
-{
- TelSatLanguageType_t language; /**< selected language info */
-} TelSatLanguageSelectionEventReqInfo_t;
-
-// 11.9 EVENT DOWNLOAD - BROWSER TERMINATION EVENT
-/**
- * This structure contains the data objects for BROWSER TERMINATION event download.
- */
-typedef struct
-{
- TelSatBrowserTerminationCauseType_t browserTerminationCause; /**< browser Termination Cause */
-} TelSatBrowserTerminationEventReqInfo_t;
-
-// 11.10 EVENT DOWNLOAD - DATA AVAILABLE EVENT
-/**
- * This struct contains SAT data available event request data
- */
-typedef struct
-{
- TelSatEventListInfo_t eventList; /**< event List */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info */
- TelSatChannelStatusInfo_t channelStatus; /**< channel status */
- TelSatChannelDataLengthInfo_t channelDataLen; /**< channel data length */
-
-} TelSatDataAvailableEventReqInfo_t;
-
-// 11.11 EVENT DOWNLOAD - CHANNEL STATUS EVENT
-/**
- * This struct contains SAT channel status even request data
- */
-typedef struct
-{
- TelSatEventListInfo_t eventList; /**< event list */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info */
- TelSatChannelStatusInfo_t channelStatus; /**< channel Status */
-} TelSatChannelStatusEventReqInfo_t;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _TEL_SAT_ENVELOPE_H_ */
-
-/**
- * @}
- */
+++ /dev/null
-/*
- * tel-plugin-dbus_tapi
- *
- * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * @open
- * @ingroup TelephonyAPI
- * @addtogroup SAT_TAPI SAT
- * @{
- *
- * @file TelSatObj.h
-
- @brief This file serves as a "C" header file defines structures for Telephony SAT Services. \n
- It contains a sample set of constants, enums, structs that would be required by applications.
- */
-
-#ifndef _TEL_SAT_OBJ_H_
-#define _TEL_SAT_OBJ_H_
-
-#include <TelDefines.h>
-#include <TelSim.h>
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-#define EXTENDED_ASCII 1
-
-#define TAPI_SAT_DIALLING_NUMBER_LEN_MAX 200 /**< max length of dialing number */
-#define TAPI_SAT_ALPHA_ID_LEN_MAX 255 /**< max length of alpha identifier */
-#define TAPI_SAT_TEXT_STRING_LEN_MAX 500 /**< max length of text string -when the string data is in 7Bit packed format, this length is not enough to support the maximum size so should increase the value to a value > 275 */
-#define TAPI_SAT_SUB_ADDR_LEN_MAX 30 /**< max length of sub address */
-#define TAPI_SAT_CCP_DATA_LEN_MAX 30 /**< max length of ccp data */
-#define TAPI_SAT_ITEM_TEXT_LEN_MAX 255 /**< max length of item text */
-#define TAPI_SAT_SMS_TPDU_SMS_DATA_LEN_MAX 175 /**< max length of sms tpdu data */
-#define TAPI_SAT_SS_STRING_LEN_MAX 160 /**< max length of ss string */
-#define TAPI_SAT_USSD_STRING_LEN_MAX 255 /**< max length of ussd string */
-#define TAPI_SAT_FILE_ID_LIST_MAX_COUNT 255 /**< max count of file id list */
-#define TAPI_SAT_ITEMS_NEXT_ACTION_INDI_LIST_MAX_COUNT 50 /**< max count of items next action indication list */
-#define TAPI_SAT_EVENT_LIST_MAX_COUNT 17 /**< max count of sat event list */
-#define TAPI_SAT_IMG_INSTANT_RAW_DATA_LEN_MAX 256 /**< max length of image instant raw */
-#define TAPI_SAT_CLUT_DATA_LEN_MAX 256 /**< max length of clut data */
-#define TAPI_SAT_IMG_DATA_FILE_PATH_LEN_MAX 50 /**< max length of image data file name (Icon, CLUT) */
-#define TAPI_SAT_ICON_LIST_MAX_COUNT 50 /**< max count of icon list */
-#define TAPI_SAT_DTMF_STRING_LEN_MAX 30 /**< max length of dtmf string */
-#define TAPI_SAT_DATE_TIME_AND_TIME_ZONE_LEN 7 /**< max length of date time and time zone */
-#define TAPI_SAT_URL_LEN_MAX 129 /**< max length of url */
-#define TAPI_SAT_BEARER_LIST_MAX_COUNT 50 /**< max count of bearer list */
-#define TAPI_SAT_PROVISIONING_FILE_PATH_LEN_MAX 50 /**< max length of provisioning file path */
-#define TAPI_SAT_BEARER_PARAMS_LEN_MAX 10 /**< max length of bearer parameters */
-#define TAPI_SAT_CHANNEL_DATA_STRING_LEN_MAX 255 /**< max length of channel data string */
-#define TAPI_SAT_CHANNEL_STATUS_LEN 2 /**< max length of channel status */
-#define TAPI_SAT_CHANNEL_ID_LEN 3 /**< max length of channel id */
-#define TAPI_SAT_OTHER_ADDR_LEN_MAX 30 /**< max length of other address */
-#define TAPI_SAT_PORT_NUMBER_LEN 2 /**< max length of port number */
-#define TAPI_SAT_NET_ACC_NAM_LEN_MAX 30 /**< max length of net acc name */
-#define TAPI_SAT_AID_LEN_MAX 128 /**< max length of aid */
-#define TAPI_SAT_REMOTE_ENTITY_ADDR_LEN_MAX 50 /**< max length of remote entity address */
-#define TAPI_SAT_ITEM_TEXT_ATTRIBUTES_LIST_MAX_COUNT 50 /**< max count of item text attributes list */
-#define TAPI_SAT_MCC_CODE_LEN 3 /**< max length of mcc */
-#define TAPI_SAT_MNC_CODE_LEN 3 /**< max length of mnc */
-#define TAPI_SAT_LAC_CODE_LEN 2 /**< max length of lac */
-#define TAPI_SAT_CELL_ID_LEN 2 /**< max length of cell id */
-
-/**
- * @enum TelSatAlphabetFormatType_t
- * This enum lists the Alphabet Format.
- */
-typedef enum {
- TAPI_SAT_ALPHABET_FORMAT_SMS_DEFAULT = 0x00, /**< ALPHABET FROMAT SMS DEFAULT */
- TAPI_SAT_ALPHABET_FORMAT_8BIT_DATA = 0x01, /**< ALPHABET FROMAT 8BIT DATA */
- TAPI_SAT_ALPHABET_FORMAT_UCS2 = 0x02, /**< ALPHABET FROMAT UCS2 */
- TAPI_SAT_ALPHABET_FORMAT_RESERVED = 0x03 /**< ALPHABET FROMAT RESERVED */
-} TelSatAlphabetFormatType_t;
-
-/**
- * @enum TelSatMsgClassType_t
- * This enum lists the message class.
- */
-typedef enum {
- TAPI_SAT_MSG_CLASS_NONE = 0x00, /**< none */
- TAPI_SAT_MSG_CLASS_0 = 0x01, /**< class 0 */
- TAPI_SAT_MSG_CLASS_1, /**< class 1 Default meaning:ME-specific */
- TAPI_SAT_MSG_CLASS_2, /**< class 2 SIM specific message */
- TAPI_SAT_MSG_CLASS_3, /**< class 3 Default meaning: TE specific */
- TAPI_SAT_MSG_CLASS_RESERVED = 0xFF /**< class reserved */
-} TelSatMsgClassType_t;
-
-/**
- * @enum TelSatCommandType_t
- * This enum lists the type of command and the next action indicator.
- */
-typedef enum {
- TAPI_SAT_CMD_TYPE_NONE = 0x00, /**< command type - None */
-
- TAPI_SAT_CMD_TYPE_REFRESH = 0x01, /**< command type - refresh */
- TAPI_SAT_CMD_TYPE_MORE_TIME = 0x02, /**< command type - more time */
- TAPI_SAT_CMD_TYPE_SETUP_EVENT_LIST = 0x05, /**< command type - setup event list */
- TAPI_SAT_CMD_TYPE_SETUP_CALL = 0x10, /**< command type - setup call */
- TAPI_SAT_CMD_TYPE_SEND_SS = 0x11, /**< command type - send ss */
- TAPI_SAT_CMD_TYPE_SEND_USSD = 0x12, /**< command type - send ussd */
- TAPI_SAT_CMD_TYPE_SEND_SMS = 0x13, /**< command type - send sms */
- TAPI_SAT_CMD_TYPE_SEND_DTMF = 0x14, /**< command type - send dtmf */
- TAPI_SAT_CMD_TYPE_LAUNCH_BROWSER = 0x15, /**< command type - launch browser */
- TAPI_SAT_CMD_TYPE_PLAY_TONE = 0x20, /**< command type - play tone */
- TAPI_SAT_CMD_TYPE_DISPLAY_TEXT = 0x21, /**< command type - display text */
- TAPI_SAT_CMD_TYPE_GET_INKEY = 0x22, /**< command type - get inkey */
- TAPI_SAT_CMD_TYPE_GET_INPUT = 0x23, /**< command type - get input */
- TAPI_SAT_CMD_TYPE_SELECT_ITEM = 0x24, /**< command type - select item */
- TAPI_SAT_CMD_TYPE_SETUP_MENU = 0x25, /**< command type - setup menu */
- TAPI_SAT_CMD_TYPE_PROVIDE_LOCAL_INFO = 0x26, /**< command type - provide local info */
- TAPI_SAT_CMD_TYPE_SETUP_IDLE_MODE_TEXT = 0x28, /**< command type - setup idle mode text */
- TAPI_SAT_CMD_TYPE_LANGUAGE_NOTIFICATION = 0x35, /**< command type - language notification */
- TAPI_SAT_CMD_TYPE_OPEN_CHANNEL = 0x40, /**< command type - open channel -class e */
- TAPI_SAT_CMD_TYPE_CLOSE_CHANNEL = 0x41, /**< command type - close channel - class e */
- TAPI_SAT_CMD_TYPE_RECEIVE_DATA = 0x42, /**< command type - receive data -class e */
- TAPI_SAT_CMD_TYPE_SEND_DATA = 0x43, /**< command type - send data */
- TAPI_SAT_CMD_TYPE_GET_CHANNEL_STATUS = 0x44, /**< command type - get channel status -class e */
- TAPI_SAT_CMD_TYPE_END_OF_APP_EXEC = 0xFD, /**< inform to End the execution of a Proactive Command*/
- TAPI_SAT_CMD_TYPE_END_PROACTIVE_SESSION = 0xFE, /**< inform end proactive session */
- TAPI_SAT_CMD_TYPE_RESERVED = 0xFF /**< command type - reserved */
-} TelSatCommandType_t;
-
-/**
- * @enum TelSatCmdQualiRefresh_t
- * This enum lists the Command qualifier values for Refresh command.
- */
-typedef enum {
- TAPI_SAT_REFRESH_SIM_INIT_AND_FULL_FCN = 0x00, /**< command qualifier for REFRESH SIM INIT AND FULL FILE CHANGE_NOTIFICATION */
- TAPI_SAT_REFRESH_FCN = 0x01, /**< command qualifier for REFRESH FILE CHANGE NOTIFICATION */
- TAPI_SAT_REFRESH_SIM_INIT_AND_FCN = 0x02, /**< command qualifier for REFRESH SIM INIT AND FILE CHANGE NOTIFICATION */
- TAPI_SAT_REFRESH_SIM_INIT = 0x03, /**< command qualifier for REFRESH SIM INIT */
- TAPI_SAT_REFRESH_SIM_RESET = 0x04, /**< command qualifier for REFRESH SIM RESET */
- TAPI_SAT_REFRESH_3G_APPLICATION_RESET = 0x05, /**< command qualifier for REFRESH 3G APPLICATION RESET */
- TAPI_SAT_REFRESH_3G_SESSION_RESET = 0x06, /**< command qualifier for REFRESH 3G SESSION RESET */
- TAPI_SAT_REFRESH_RESERVED = 0xFF /**< command qualifier for REFRESH RESERVED */
-} TelSatCmdQualiRefresh_t;
-
-/**
- * @enum TelSatCmdQualiSetupCall_t
- * This enum lists the Command qualifier values for setup call command.
- */
-typedef enum {
- TAPI_SAT_SETUP_CALL_IF_ANOTHER_CALL_NOT_BUSY = 0x00, /**< command qualifier for SETUP CALL IF ANOTHER CALL NOT BUSY */
- TAPI_SAT_SETUP_CALL_IF_ANOTHER_CALL_NOT_BUSY_WITH_REDIAL = 0x01, /**< command qualifier for SETUP CALL IF ANOTHER CALL NOT BUSY WITH REDIAL */
- TAPI_SAT_SETUP_CALL_PUT_ALL_OTHER_CALLS_ON_HOLD = 0x02, /**< command qualifier for SETUP CALL PUTTING ALL OTHER CALLS ON HOLD */
- TAPI_SAT_SETUP_CALL_PUT_ALL_OTHER_CALLS_ON_HOLD_WITH_REDIAL = 0x03, /**< command qualifier for SETUP CALL PUTTING ALL OTHER CALLS ON HOLD WITH REDIAL */
- TAPI_SAT_SETUP_CALL_DISCONN_ALL_OTHER_CALLS = 0x04, /**< command qualifier for SETUP CALL DISCONNECTING ALL OTHER CALLS */
- TAPI_SAT_SETUP_CALL_DISCONN_ALL_OTHER_CALLS_WITH_REDIAL = 0x05, /**< command qualifier for SETUP CALL DISCONNECTING ALL OTHER CALLS WITH REDIAL */
- TAPI_SAT_SETUP_CALL_RESERVED = 0xFF /**< command qualifier for SETUP CALL RESERVED */
-} TelSatCmdQualiSetupCall_t;
-
-/**
- * @enum TelSatDisplayTextPriorityType_t
- * This is associated with the command qualifier for display text.
- */
-typedef enum {
- TAPI_SAT_MSG_PRIORITY_NORMAL = 0, /**< MSG PRIORITY NORMAL */
- TAPI_SAT_MSG_PRIORITY_HIGH = 1 /**< MSG PRIORITY HIGH */
-} TelSatDisplayTextPriorityType_t;
-
-/**
- * @enum TelSatDisplayTextMsgClearType_t
- * This is associated with the command qualifier for display text.
- */
-typedef enum {
- TAPI_SAT_AUTO_CLEAR_MSG_AFTER_A_DELAY = 0, /**< message clear type - AUTO CLEAR MSG AFTER A DELAY */
- TAPI_SAT_WAIT_FOR_USER_TO_CLEAR_MSG = 1 /**< message clear type - WAIT FOR USER TO CLEAR MSG */
-} TelSatDisplayTextMsgClearType_t;
-
-/**
- * @enum TelSatInkeyType_t
- * This is associated with the command qualifier for get inkey.
- */
-typedef enum {
- TAPI_SAT_INKEY_TYPE_CHARACTER_SET_ENABLED = 0, /**< command qualifier for INKEY TYPE CHARACTER SET ENABLED */
- TAPI_SAT_INKEY_TYPE_YES_NO_REQUESTED = 1 /**< command qualifier for INKEY TYPE YES NO REQUESTED */
-} TelSatInkeyType_t;
-
-/**
- * @enum TelSatUseInputAlphabetType_t
- * This is associated with the command qualifier for get input.
- */
-typedef enum {
- TAPI_SAT_USER_INPUT_ALPHABET_TYPE_SMS_DEFAULT = 1, /**< command qualifier for ALPHABET TYPE SMS DEFAULT */
- TAPI_SAT_USER_INPUT_ALPHABET_TYPE_UCS2 = 2 /**< command qualifier for ALPHABET TYPE UCS2 */
-} TelSatUseInputAlphabetType_t;
-
-/**
- * @enum TelSatDisplayVibrateAlertType_t
- * This is associated with the command qualifier for play tone command.
- */
-typedef enum {
- TAPI_SAT_VIBRATE_ALERT_OPTIONAL = 0, /**< VIBRATE ALERT UPTO THE TERMINAL */
- TAPI_SAT_VIBRATE_ALERT_REQUIRED = 1 /**< VIBRATE, IF AVAILABLE, WITH TONE. */
-} TelSatDisplayVibrateAlertType_t;
-
-/**
- * @enum TelSatPresentationType_t
- * This is associated with the command qualifier for select item command.
- */
-typedef enum {
- TAPI_SAT_PRESENTATION_TYPE_NOT_SPECIFIED = 0x00, /**< command qualifier for PRESENTATION TYPE NOT SPECIFIED */
- TAPI_SAT_PRESENTATION_TYPE_DATA_VALUE = 0x01, /**< command qualifier for PRESENTATION TYPE DATA VALUE */
- TAPI_SAT_PRESENTATION_TYPE_NAVIGATION_OPTION = 0x02 /**< command qualifier for PRESENTATION TYPE NAVIGATION OPTION */
-} TelSatPresentationType_t;
-
-/**
- * @enum TelSatSelectionPreferenceType_t
- * This is associated with the command qualifier for select item command.
- */
-typedef enum {
- TAPI_SAT_SELECTION_PREFERENCE_NONE_REQUESTED = 0, /**< command qualifier for SELECTION PREFERENCE NONE REQUESTED */
- TAPI_SAT_SELECTION_PREFERENCE_USING_SOFT_KEY = 1 /**< command qualifier for SELECTION PREFERENCE USING SOFT KEY */
-} TelSatSelectionPreferenceType_t;
-
-/**
- * @enum TelSatCmdQualiProvideLocalInfo_t
- * This enum defines the Command qualifier values for provide local info command.
- */
-typedef enum {
- TAPI_SAT_PROVIDE_DATE_TIME_AND_TIME_ZONE = 0x03, /**< command qualifier for PROVIDE DATE TIME AND TIME ZONE */
- TAPI_SAT_PROVIDE_LANGUAGE_SETTING = 0x04, /**< command qualifier for PROVIDE LANGUAGE SETTING */
- TAPI_SAT_PROVIDE_IMEISV = 0x08, TAPI_SAT_PROVIDE_RESERVED = 0xFF /**< reserved */
-} TelSatCmdQualiProvideLocalInfo_t;
-
-/**
- * @enum TelSatCmdQualiLaunchBrowser_t
- * This enum defines the Command qualifier values for launch browser command.
- */
-typedef enum {
- TAPI_SAT_LAUNCH_BROWSER = 0, /**< command qualifier for LAUNCH BROWSER */
- TAPI_SAT_NOT_USED = 1, /**< command qualifier for NOT USED */
- TAPI_SAT_USE_EXISTING_BROWSER = 2, /**< command qualifier for USE EXISTING BROWSER if secure session, do not use it. */
- TAPI_SAT_CLOSE_AND_LAUNCH_NEW_BROWSER = 3, /**< command qualifier for CLOSE AND LAUNCH NEW BROWSER */
- TAPI_SAT_NOT_USED2 = 4, /**< command qualifier for NOT USED2 */
- TAPI_SAT_LB_RESERVED = 0xFF /**< reserved */
-} TelSatCmdQualiLaunchBrowser_t;
-
-/**
- * @enum TelSatDeviceIdentitiesTagType_t
- * This enum lists the device identity tag value IDs.
- */
-typedef enum {
- TAPI_SAT_DEVICE_ID_KEYPAD = 0x01, /**< DEVICE ID KEYPAD */
- TAPI_SAT_DEVICE_ID_DISPLAY = 0x02, /**< DEVICE ID DISPLAY */
- TAPI_SAT_DEVICE_ID_EARPIECE = 0x03, /**< DEVICE ID EARPIECE */
-
- TAPI_SAT_DEVICE_ID_SIM = 0x81, /**< DEVICE ID SIM */
- TAPI_SAT_DEVICE_ID_ME = 0x82, /**< DEVICE ID ME */
- TAPI_SAT_DEVICE_ID_NETWORK = 0x83, /**< DEVICE ID NETWORK */
-
- TAPI_SAT_DEVICE_ID_RESERVED = 0XFF /**< reserved */
-} TelSatDeviceIdentitiesTagType_t;
-
-/**
- * @enum TelSatTimeUnitType_t
- * This enum lists the time units for the duration data object.
- */
-typedef enum {
- TAPI_SAT_TIME_UNIT_MINUTES = 0x0, /**< time unit - minutes */
- TAPI_SAT_TIME_UNIT_SECONDS = 0x01, /**< time unit - second */
- TAPI_SAT_TIME_UNIT_TENTHS_OF_SECONDS = 0x02, /**< time unit - tenths of seconds */
- TAPI_SAT_TIME_UNIT_RESERVED = 0xFF /**< reserved */
-} TelSatTimeUnitType_t;
-
-/**
- * @enum TelSatResultType_t
- * This enum lists the values for the RESULT data object - General Response.
- */
-typedef enum {
- TAPI_SAT_R_SUCCESS = 0x0, /**< command performed successfully */
- TAPI_SAT_R_SUCCESS_WITH_PARTIAL_COMPREHENSION = 0x01, /**< command performed with partial comprehension */
- TAPI_SAT_R_SUCCESS_WITH_MISSING_INFO = 0x02, /**< command performed, with missing information */
-
- TAPI_SAT_R_REFRESH_PERFORMED_WITH_ADDITIONAL_EFS_READ = 0x03, /**< REFRESH PERFORMED WITH ADDITIONAL EFS READ */
- TAPI_SAT_R_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED = 0x04, /**< command performed but REQUESTED ICON NOT DISPLAYED */
- TAPI_SAT_R_SUCCESS_BUT_MODIFIED_BY_CALL_CONTROL_BY_SIM = 0x05, /**< command performed but MODIFIED BY CALL CONTROL BY SIM */
- TAPI_SAT_R_SUCCESS_LIMITED_SERVICE = 0x06, /**< command performed with LIMITED SERVICE */
- TAPI_SAT_R_SUCCESS_WITH_MODIFICATION = 0x07, /**< command performed with MODIFICATION */
- TAPI_SAT_R_REFRESH_PRFRMD_BUT_INDICATED_USIM_NOT_ACTIVE = 0x08, /**< REFRESH PERFORMED BUT INDICATED USIM NOT ACTIVE */
-
- TAPI_SAT_R_PROACTIVE_SESSION_TERMINATED_BY_USER = 0x10, /**< proactive sim application session terminated by user */
- TAPI_SAT_R_BACKWARD_MOVE_BY_USER = 0x11, /**< backward move in the proactive sim application session request by the user */
- TAPI_SAT_R_NO_RESPONSE_FROM_USER = 0x12, /**< no response from user */
-
- TAPI_SAT_R_HELP_INFO_REQUIRED_BY_USER = 0x13, /**< HELP INFO REQUIRED BY USER */
- TAPI_SAT_R_USSD_OR_SS_TRANSACTION_TERMINATED_BY_USER = 0x14, /**< USSD OR SS TRANSACTION TERMINATED BY USER */
-
- TAPI_SAT_R_ME_UNABLE_TO_PROCESS_COMMAND = 0x20, /**< ME currently unable to process command */
- TAPI_SAT_R_NETWORK_UNABLE_TO_PROCESS_COMMAND = 0x21, /**< Network currently unable to process command */
- TAPI_SAT_R_USER_DID_NOT_ACCEPT_CALL_SETUP_REQ = 0x22, /**< User did not accept call setup request */
- TAPI_SAT_R_USER_CLEAR_DOWN_CALL_BEFORE_CONN = 0x23, /**< User cleared down call before connection or network released */
-
- TAPI_SAT_R_INTERACTION_WITH_CC_BY_SIM_IN_TMP_PRBLM = 0x25, /**< INTERACTION WITH CALL CONTROL BY SIM IN TEMPORARY PROBLEM */
- TAPI_SAT_R_LAUNCH_BROWSER_GENERIC_ERROR_CODE = 0x26, /**< LAUNCH BROWSER GENERIC ERROR CODE */
-
- TAPI_SAT_R_BEYOND_ME_CAPABILITIES = 0x30, /**< command beyond ME's capabilities */
- TAPI_SAT_R_COMMAND_TYPE_NOT_UNDERSTOOD_BY_ME = 0x31, /**< command type not understood by ME */
- TAPI_SAT_R_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME = 0x32, /**< command data not understood by ME */
- TAPI_SAT_R_COMMAND_NUMBER_NOT_KNOWN_BY_ME = 0x33, /**< command number not known by ME */
- TAPI_SAT_R_SS_RETURN_ERROR = 0x34, /**< SS return error */
- TAPI_SAT_R_SMS_RP_ERROR = 0x35, /**< SMS rp-error */
- TAPI_SAT_R_ERROR_REQUIRED_VALUES_ARE_MISSING = 0x36, /**< Error, required values are missing */
-
- TAPI_SAT_R_USSD_RETURN_ERROR = 0x37, /**< USSD_RETURN_ERROR */
- TAPI_SAT_R_INTRCTN_WITH_CC_OR_SMS_CTRL_PRMNT_PRBLM = 0x39, /**< INTERACTION WITH CALL CONTROL OR SMS CONTROL PERMANENT PROBLEM */
- TAPI_SAT_R_BEARER_INDEPENDENT_PROTOCOL_ERROR = 0x3A, /**< BEARER INDEPENDENT PROTOCOL ERROR */
- TAPI_SAT_R_FRAMES_ERROR = 0x3C /**< FRAMES ERROR */
-} TelSatResultType_t;
-
-/**
- * @enum TelSatMeProblemType_t
- * This enum lists the values for the Additional response for the RESULT object and specifies a particular ME PROBLEM.
- */
-typedef enum {
- TAPI_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE = 0x0, /**< ME problem with NO SPECIFIC CAUSE */
- TAPI_SAT_ME_PROBLEM_SCREEN_BUSY = 0x01, /**< ME problem with SCREEN BUSY */
- TAPI_SAT_ME_PROBLEM_ME_BUSY_ON_CALL = 0x02, /**< ME problem with ME BUSY ON CALL */
- TAPI_SAT_ME_PROBLEM_ME_BUSY_ON_SS = 0x03, /**< ME problem with ME_BUSY ON SS */
- TAPI_SAT_ME_PROBLEM_NO_SERVICE = 0x04, /**< ME problem with NO SERVICE */
- TAPI_SAT_ME_PROBLEM_ACCESS_CONTROL_CLASS_BAR = 0x05, /**< ME problem with ACCESS CONTROL CLASS BAR */
- TAPI_SAT_ME_PROBLEM_RADIO_RES_NOT_GRANTED = 0x06, /**< ME problem with RADIO RES NOT GRANTED */
- TAPI_SAT_ME_PROBLEM_NOT_IN_SPEECH_CALL = 0x07, /**< ME problem with NOT IN SPEECH CALL */
- TAPI_SAT_ME_PROBLEM_ME_BUSY_ON_USSD = 0x08, /**< ME problem with ME BUSY ON USSD */
- TAPI_SAT_ME_PROBLEM_ME_BUSY_ON_SEND_DTMF_CMD = 0x09, /**< ME problem with ME BUSY ON SEND DTMF CMD */
- TAPI_SAT_ME_PROBLEM_NO_USIM_ACTIVE = 0x0A, /**< ME problem with NO USIM ACTIVE */
- TAPI_SAT_ME_PROBLEM_INVALID = 0xFF /**< ME problem with INVALID */
-} TelSatMeProblemType_t;
-
-/**
- * @enum TelSatNetworkProblemType_t
- * This enum lists the values for the Additional response for the RESULT object and specifies a particular network PROBLEM.
- */
-typedef enum {
- TAPI_SAT_NETWORK_PROBLEM_NO_SPECIFIC_CAUSE = 0x0, /**< Network problem with no specific cause */
- TAPI_SAT_NETWORK_PROBLEM_USER_BUSY = 0x91 /**< Network problem with USER BUSY */
-} TelSatNetworkProblemType_t;
-
-/**
- * @enum TelSatSsProblemType_t
- * This enum lists the values for the Additional response for the RESULT object related to SEND SS.
- */
-typedef enum {
- TAPI_SAT_SS_PROBLEM_NO_SPECIFIC_CAUSE = 0, /**< SS problem with no specific cause */
- TAPI_SAT_SS_PROBLEM_FACILITY_NOT_SUPPORTED = 0x15 /**< SS problem with FACILITY NOT SUPPORTED */
-} TelSatSsProblemType_t;
-
-/**
- * @enum TelSatSmsProblemType_t
- * This enum lists the values for the Additional response for the RESULT object related to SEND SMS.
- */
-typedef enum {
- TAPI_SAT_SMS_PROBLEM_NO_SPECIFIC_CAUSE = 0 /**< SMS problem with no specific cause */
-} TelSatSmsProblemType_t;
-
-/**
- * @enum TelSatUssdProblemType_t
- * This enum lists the values for the Additional response for the RESULT object related to SEND USSD STRING.
- */
-typedef enum {
- TAPI_SAT_USSD_PROBLEM_NO_SPECIFIC_CAUSE = 0, /**< USSD problem with no specific cause */
- TAPI_SAT_USSD_PROBLEM_UNKNOWN_ALPHABET = 0x47 /**< USSD problem with UNKNOWN ALPHABET */
-} TelSatUssdProblemType_t;
-
-/**
- * @enum TelSatCallCtrlProblemType_t
- * This enum lists the values for the Additional response for the RESULT object related to CALL CONTROL or MO SMS CONTROL.
- */
-typedef enum {
- TAPI_SAT_CC_PROBLEM_NO_SPECIFIC_CAUSE = 0, /**< Call Control problem with no specific cause */
- TAPI_SAT_CC_PROBLEM_ACTION_NOT_ALLOWED = 1, /**< Call Control problem with action not allowed */
- TAPI_SAT_CC_PROBLEM_REQUEST_TYPE_HAS_CHANGED = 2 /**< Call Control problem with request type has changed */
-} TelSatCallCtrlProblemType_t;
-
-/**
- * @enum TelSatLaunchBrowserProblemType_t
- * This enum lists the values for the Additional response for the RESULT object related to LAUNCH BROWSER PROBLEM
- */
-typedef enum {
- TAPI_SAT_BROWSER_PROBLEM_NO_SPECIFIC_CAUSE = 0, /**< Browser problem with no specific cause */
- TAPI_SAT_BROWSER_PROBLEM_BEARER_UNAVAILABLE = 1, /**< Browser problem with bearer unavailable */
- TAPI_SAT_BROWSER_PROBLEM_BROWSER_UNAVAILABLE = 2, /**< Browser problem with browser unavailable */
- TAPI_SAT_BROWSER_PRBLM_ME_UNABLE_TO_READ_PROV_DATA = 3 /**< Browser problem with ME unable to read provisioning data */
-} TelSatLaunchBrowserProblemType_t;
-
-/**
- * @enum TelSatBipProblemType_t
- * This enum lists the values for the Additional response for the RESULT object.
- * Permanent Problems ::: 12.12.11 ADDITIONAL INFORMATION : BEARER INDEPENDENT PROTOCOL
- */
-typedef enum {
- TAPI_SAT_BIP_PROBLEM_NO_SPECIFIC_CAUSE = 0x00, /**< BIP problem with no specific cause */
- TAPI_SAT_BIP_PROBLEM_NO_CHANNEL_AVAILABLE = 0x01, /**< BIP problem with no channel available */
- TAPI_SAT_BIP_PROBLEM_CHANNEL_CLOSED = 0x02, /**< BIP problem with channel closed */
- TAPI_SAT_BIP_PROBLEM_CHANNEL_ID_NOT_VALID = 0x03, /**< BIP problem with channel id not valid */
- TAPI_SAT_BIP_PROBLEM_BUF_SIZE_NOT_AVAILABLE = 0x04, /**< BIP problem with buffer size not available */
- TAPI_SAT_BIP_PROBLEM_SECURITY_ERROR = 0x05, /**< BIP problem with security error */
- TAPI_SAT_BIP_PRBLM_SIM_ME_IF_TRNSPRT_LEVEL_NOT_AVL = 0x06, /**< BIP problem with SIM ME interface transport level not available */
- TAPI_SAT_BIP_REMOTE_DEV_NOT_REACHABLE = 0x07, /**< BIP problem with remote device not reachable */
- TAPI_SAT_BIP_SERVICE_ERROR = 0x08, /**< BIP service error */
- TAPI_SAT_BIP_SERVICE_IDENTIFIER_UNKNOWN = 0x09 /**< BIP service identifier unknown */
-} TelSatBipProblemType_t;
-
-/**
- * @enum TelSatSmsTpduType_t
- * This enum lists the values for the SMS TPDU type.
- */
-typedef enum {
- TAPI_SAT_SMS_TPDU_TYPE_DELIVER_TPDU = 0, /**< sms tpdu type - DELIVER TPDU */
- TAPI_SAT_SMS_TPDU_TYPE_DELIVER_RPT = 1, /**< sms tpdu type - DELIVER RPT */
- TAPI_SAT_SMS_TPDU_TYPE_SUBMIT_TPDU = 2, /**< sms tpdu type - SUBMIT TPDU */
- TAPI_SAT_SMS_TPDU_TYPE_SUBMIT_RPT = 3, /**< sms tpdu type - SUBMIT RPT */
- TAPI_SAT_SMS_TPDU_TYPE_STATUS_RPT = 4, /**< sms tpdu type - STATUS RPT */
- TAPI_SAT_SMS_TPDU_TYPE_TPDU_CMD = 5 /**< sms tpdu type - TPDU CMD */
-} TelSatSmsTpduType_t;
-
-/**
- * @enum TelSatToneType_t
- * This enum lists the values tones type.
- */
-typedef enum {
- // standard supervisory tones
- TAPI_SAT_DIAL_TONE = 0x01, /**< TONE TYPE DIAL TONE */
- TAPI_SAT_CALLED_SUBSCRIBER_BUSY = 0x02, /**< TONE TYPE CALLED SUBSCRIBER BUSY */
- TAPI_SAT_CONGESTION = 0x03, /**< TONE TYPE CONGESTION */
- TAPI_SAT_RADIO_PATH_ACK = 0x04, /**< TONE TYPE RADIO PATH ACK */
- TAPI_SAT_RADIO_PATH_NOT_AVAILABLE_CALL_DROPPED = 0x05, /**< TONE TYPE RADIO PATH NOT AVAILABLE CALL DROPPED */
- TAPI_SAT_ERR_SPECIAL_INFO = 0x06, /**< TONE TYPE ERR SPECIAL INFO */
- TAPI_SAT_CALL_WAITING_TONE = 0x07, /**< TONE TYPE CALL WAITING TONE */
- TAPI_SAT_RINGING_TONE = 0x08, /**< TONE TYPE RINGING TONE */
-
- // ME proprietary tones
- TAPI_SAT_GENERAL_BEEP = 0x10, /**< TONE TYPE GENERAL BEEP */
- TAPI_SAT_POSITIVE_ACK_TONE = 0x11, /**< TONE TYPE POSITIVE ACK TONE */
- TAPI_SAT_NEGATIVE_ACK_OR_ERROR_TONE = 0x12, /**< TONE TYPE NEGATIVE ACK OR ERROR TONE */
- TAPI_SAT_RINGING_TONE_SLCTD_BY_USR_FOR_INCOM_SPEECH_CALL = 0x13, /**< TONE TYPE RINGING TONE SELECTED BY USER FOR INCOMING SPEECH CALL */
- TAPI_SAT_ALERT_TONE_SELECTED_BY_USER_FOR_INCOMING_SMS = 0x14, /**< TONE TYPE ALERT TONE SELECTED BY USER FOR INCOMING SMS */
- TAPI_SAT_CRITICAL_ALERT = 0x15, /**< TONE TYPE CRITICAL ALERT */
-
- //Themed tones
- TAPI_SAT_HAPPY_TONE = 0x30, /**< TONE TYPE HAPPY TONE */
- TAPI_SAT_SAD_TONE = 0x31, /**< TONE TYPE SAD TONE */
- TAPI_SAT_URGENT_ACTION_TONE = 0x32, /**< TONE TYPE URGENT ACTION TONE */
- TAPI_SAT_QUESTION_TONE = 0x33, /**< TONE TYPE QUESTION TONE */
- TAPI_SAT_MESSAGE_RECEIVED_TONE = 0x34, /**< TONE TYPE MESSAGE RECEIVED TONE */
-
- //Melody tones
- TAPI_SAT_MELODY_1 = 0x40, /**< TONE TYPE MELODY 1 */
- TAPI_SAT_MELODY_2 = 0x41, /**< TONE TYPE MELODY 2 */
- TAPI_SAT_MELODY_3 = 0x42, /**< TONE TYPE MELODY 3 */
- TAPI_SAT_MELODY_4 = 0x43, /**< TONE TYPE MELODY 4 */
- TAPI_SAT_MELODY_5 = 0x44, /**< TONE TYPE MELODY 5 */
- TAPI_SAT_MELODY_6 = 0x45, /**< TONE TYPE MELODY 6 */
- TAPI_SAT_MELODY_7 = 0x46, /**< TONE TYPE MELODY 7 */
- TAPI_SAT_MELODY_8 = 0x47, /**< TONE TYPE MELODY 8 */
-
- TAPI_SAT_TONE_TYPE_RESERVED = 0xFF /**< TONE TYPE RESERVED */
-} TelSatToneType_t;
-
-/**
- * @enum TelSatEventDownloadType_t
- * This enum lists event types required by ME to monitor and report to SIM.
- */
-typedef enum {
- TAPI_EVENT_SAT_DW_TYPE_MT_CALL = 0,
- TAPI_EVENT_SAT_DW_TYPE_CALL_CONNECTED = 1,
- TAPI_EVENT_SAT_DW_TYPE_CALL_DISCONNECTED = 2,
- TAPI_EVENT_SAT_DW_TYPE_LOCATION_STATUS = 3,
- TAPI_EVENT_SAT_DW_TYPE_USER_ACTIVITY = 4, /**< data download type - USER_ACTIVITY */
- TAPI_EVENT_SAT_DW_TYPE_IDLE_SCREEN_AVAILABLE = 5, /**< data download type - IDLE SCREEN AVAILABLE */
- TAPI_EVENT_SAT_DW_TYPE_CARD_READER_STATUS = 6,
- TAPI_EVENT_SAT_DW_TYPE_LANGUAGE_SELECTION = 7, /**< data download type - LANGUAGE SELECTION */
- TAPI_EVENT_SAT_DW_TYPE_BROWSER_TERMINATION = 8, /**< data download type - BROWSER TERMINATION */
- TAPI_EVENT_SAT_DW_TYPE_DATA_AVAILABLE = 9, /**< data download type -DATA AVAILABLE */
- TAPI_EVENT_SAT_DW_TYPE_CHANNEL_STATUS = 0x0A, /**< data download type - CHANNEL STATUS */
- TAPI_EVENT_SAT_DW_TYPE_ACCESS_TECHNOLOGY_CHANGED = 0x0B,
- TAPI_EVENT_SAT_DW_TYPE_DISPLAY_PARAMETERS_CHANGED = 0x0C,
- TAPI_EVENT_SAT_DW_TYPE_LOCAL_CONNECTION = 0x0D,
- TAPI_EVENT_SAT_DW_TYPE_NW_SEARCH_MODE_CHANGED = 0X0E,
- TAPI_EVENT_SAT_DW_TYPE_BROWSING_STATUS = 0X0F,
- TAPI_EVENT_SAT_DW_TYPE_FRAMES_INFORMATION_CHANGED = 0X10,
- TAPI_EVENT_SAT_DW_TYPE_RESERVED_FOR_3GPP = 0X11,
- TAPI_EVENT_SAT_DW_TYPE_UNKNOWN = 0xFF /**< data download type - unknown */
-} TelSatEventDownloadType_t;
-
-/**
- * @enum TelSatImageCodingSchemeType_t
- * This enum lists image coding scheme types required by ME to show.
- */
-typedef enum {
- TAPI_SAT_SIM_IMAGE_CODING_SCHEME_BASIC = 0x11, /**< IMAGE CODING SCHEME BASIC */
- TAPI_SAT_SIM_IMAGE_CODING_SCHEME_COLOUR = 0x21, /**< IMAGE CODING SCHEME COLOUR */
- TAPI_SAT_SIM_IMAGE_CODING_SCHEME_RESERVED = 0xFF /**< RESERVED */
-} TelSatImageCodingSchemeType_t;
-
-/**
- * @enum TelSatIconQualifierType_t
- * This enum defines the icon qualifier.
- */
-typedef enum {
- TAPI_SAT_ICON_QUALI_SELF_EXPLANATORY = 0, /**< ICON QUALI SELF EXPLANATORY */
- TAPI_SAT_ICON_QUALI_NOT_SELF_EXPLANATORY = 1, /**< ICON QUALI NOT SELF EXPLANATORY */
- TAPI_SAT_ICON_QUALI_RESERVED = 0xFF /**< RESERVED */
-} TelSatIconQualifierType_t;
-
-/**
- * @enum TelSatBcRepeatIndicatorType_t
- * This enum defines the SIM ATK BC repeat indicator type.
- */
-typedef enum {
- TAPI_SAT_BC_REPEAT_INDI_ALTERNATE_MODE = 0x01, /**< BC REPEAT ALTERNATE MODE */
- TAPI_SAT_BC_REPEAT_INDI_SEQUENTIAL_MODE = 0x03, /**< BC REPEAT SEQUENTIAL MODE */
- TAPI_SAT_BC_REPEAT_INDI_RESERVED = 0xFF /**< RESERVED */
-} TelSatBcRepeatIndicatorType_t;
-
-/**
- * @enum TelSatCallCtrlStringType_t
- * This enum defines call control string type.
- */
-typedef enum {
- TAPI_SAT_CC_VOICE = 0x00, /**< Call Control String Type - voice */
- TAPI_SAT_CC_SS = 0x01, /**< Call Control String Type - ss */
- TAPI_SAT_CC_USSD = 0x02, /**< Call Control String Type - ussd */
- TAPI_SAT_CC_NONE = 0xFF /**< Call Control String Type - none */
-} TelSatCallCtrlStringType_t;
-
-/**
- * @enum TelSatLanguageType_t
- * This enum lists the language values.
- */
-typedef enum {
- TAPI_SAT_LP_GERMAN = 0x00, /**< GERMAN */
- TAPI_SAT_LP_ENGLISH = 0x01, /**< ENGLISH */
- TAPI_SAT_LP_ITALIAN = 0x02, /**< ITALIAN */
- TAPI_SAT_LP_FRENCH = 0x03, /**< FRENCH */
- TAPI_SAT_LP_SPANISH = 0x04, /**< SPANISH */
- TAPI_SAT_LP_DUTCH = 0x05, /**< DUTCH */
- TAPI_SAT_LP_SWEDISH = 0x06, /**< SWEDISH */
- TAPI_SAT_LP_DANISH = 0x07, /**< DANISH */
- TAPI_SAT_LP_PORTUGUESE = 0x08, /**< PORTUGUESE */
- TAPI_SAT_LP_FINNISH = 0x09, /**< FINNISH */
- TAPI_SAT_LP_NORWEGIAN = 0x0A, /**< NORWEGIAN */
- TAPI_SAT_LP_GREEK = 0x0B, /**< GREEK */
- TAPI_SAT_LP_TURKISH = 0x0C, /**< TURKISH */
- TAPI_SAT_LP_HUNGARIAN = 0x0D, /**< HUNGARIAN */
- TAPI_SAT_LP_POLISH = 0x0E, /**< POLISH */
- TAPI_SAT_LP_LANG_UNSPECIFIED = 0x0F /**< LANGUAGE UNSPECIFIED */
-} TelSatLanguageType_t;
-
-/**
- * @enum TelSatBrowserIdentityType_t
- * This enum lists the SAT browser identity type.
- */
-typedef enum {
- TAPI_SAT_BROWSER_ID_DEFAULT = 0x0, /**< DEFAULT BROWSER */
- TAPI_SAT_BROWSER_ID_WML, /**< BROWSER WML */
- TAPI_SAT_BROWSER_ID_HTML, /**< BROWSER HTML */
- TAPI_SAT_BROWSER_ID_XHTML, /**< BROWSER XHTML */
- TAPI_SAT_BROWSER_ID_CHTML, /**< BROWSER CHTML */
- TAPI_SAT_BROWSER_ID_RESERVED = 0xFF /**< RESERVED */
-} TelSatBrowserIdentityType_t;
-
-/**
- * @enum TelSatBearerType_t
- * This enum lists the SAT bearer type.
- */
-typedef enum {
- TAPI_SAT_BEARER_TYPE_SMS = 0x0, /**< BEARER SMS */
- TAPI_SAT_BEARER_TYPE_CSD = 0x1, /**< BEARER CSD */
- TAPI_SAT_BEARER_TYPE_USSD = 0x2, /**< BEARER USSD */
- TAPI_SAT_BEARER_TYPE_GPRS = 0x3, /**< BEARER GPRS */
- TAPI_SAT_BEARER_TYPE_RESERVED = 0xFF /**< BEARER RESERVED */
-} TelSatBearerType_t;
-
-/**
- * @enum TelSatBrowserTerminationCauseType_t
- * This enum lists the SAT browser termination cause type.
- */
-typedef enum {
- TAPI_SAT_BROWSER_TERMINATED_BY_USER = 0, /**< BROWSER TERMINATED BY USER */
- TAPI_SAT_BROWSER_TERMINATED_BY_ERROR = 1, /**< BROWSER TERMINATED BY ERROR */
-} TelSatBrowserTerminationCauseType_t;
-
-/**
- * @enum TelSatBearerDescType_t
- * This enum lists the SAT bearer destination type.
- */
-typedef enum {
- TAPI_SAT_BEARER_CSD = 0x1, /**< BEARER DESC CSD */
- TAPI_SAT_BEARER_GPRS = 0x2, /**< BEARER DESC GPRS */
- TAPI_SAT_BEARER_DEFAULT_BEARER_FROM_TRANSPORT_LAYER = 0x3, /**< BEARER DESC DEFAULT BEARER FROM TRANSPORT LAYER */
- TAPI_SAT_BEARER_LOCAL_LINK_TECHNOLOGY_INDEPENDENT = 0x4, /**< BEARER DESC LOCAL LINK TECHNOLOGY INDEPENDENT */
- TAPI_SAT_BEARER_BLUETOOTH = 0x5, /**< BEARER DESC BLUETOOTH */
- TAPI_SAT_BEARER_IrDA = 0x6, /**< BEARER DESC IrDA */
- TAPI_SAT_BEARER_RS232 = 0x7, /**< BEARER DESC RS232 */
- TAPI_SAT_BEARER_USB = 0x10, /**< BEARER DESC USB */
- TAPI_SAT_BEARER_RESERVED = 0xFF /**< RESERVED */
-} TelSatBearerDescType_t;
-
-/**
- * @enum TelSatBearerParamCsdDataRateType_t
- * This enum lists the SAT bearer parameter csd data rate. refer TS 27.007
- */
-typedef enum {
- TAPI_SAT_BIP_DR_AUTOBAUDING = 0, /**< CSD data rate - AUTOBAUDING */
- TAPI_SAT_BIP_DR_300BPS_V21 = 1, /**< CSD data rate -300BPS V21 */
- TAPI_SAT_BIP_DR_1200BPS_V22 = 2, /**< CSD data rate - 1200BPS V22 */
- TAPI_SAT_BIP_DR_1200_75BPS_V23 = 3, /**< CSD data rate -1200 75BPS V23 */
- TAPI_SAT_BIP_DR_2400BPS_V22 = 4, /**< CSD data rate -2400BPS V22 */
- TAPI_SAT_BIP_DR_2400BPS_V26 = 5, /**< CSD data rate - 2400BPS V26 */
- TAPI_SAT_BIP_DR_4800BPS_V32 = 6, /**< CSD data rate - 4800BPS V32 */
- TAPI_SAT_BIP_DR_9600BPS_V32 = 7, /**< CSD data rate - 9600BPS V32 */
- TAPI_SAT_BIP_DR_9600BPS_V34 = 12, /**< CSD data rate - 9600BPS_V34 */
- TAPI_SAT_BIP_DR_14400BPS_V34 = 14, /**< CSD data rate -14400BPS V34 */
- TAPI_SAT_BIP_DR_19200BPS_V34 = 15, /**< CSD data rate -19200BPS V34 */
- TAPI_SAT_BIP_DR_28800BPS_V34 = 16, /**< CSD data rate -28800BPS V34 */
- TAPI_SAT_BIP_DR_33600BPS_V34 = 17, /**< CSD data rate -33600BPS V34 */
- TAPI_SAT_BIP_DR_1200BPS_V120 = 34, /**< CSD data rate -1200BPS V120 */
- TAPI_SAT_BIP_DR_2400BPS_V120 = 36, /**< CSD data rate -2400BPS V120 */
- TAPI_SAT_BIP_DR_4800BPS_V120 = 38, /**< CSD data rate -4800BPS V120 */
- TAPI_SAT_BIP_DR_9600BPS_V120 = 39, /**< CSD data rate -9600BPS V120 */
- TAPI_SAT_BIP_DR_14400BPS_V120 = 43, /**< CSD data rate -14400BPS V120 */
- TAPI_SAT_BIP_DR_19200BPS_V120 = 47, /**< CSD data rate -19200BPS V120 */
- TAPI_SAT_BIP_DR_28800BPS_V120 = 48, /**< CSD data rate -28800BPS V120 */
- TAPI_SAT_BIP_DR_38400BPS_V120 = 49, /**< CSD data rate -38400BPS V120 */
- TAPI_SAT_BIP_DR_48000BPS_V120 = 50, /**< CSD data rate -48000BPS V120 */
- TAPI_SAT_BIP_DR_56000BPS_V120 = 51, /**< CSD data rate -56000BPS V120 */
- TAPI_SAT_BIP_DR_300BPS_V110 = 65, /**< CSD data rate - 300BPS V110 */
- TAPI_SAT_BIP_DR_1200BPS_V110 = 66, /**< CSD data rate -1200BPS V110 */
- TAPI_SAT_BIP_DR_2400BPS_V110_OR_X31_FALG_STUFFING = 68, /**< CSD data rate - 2400BPS V110 OR X31 FALG STUFFING */
- TAPI_SAT_BIP_DR_4800BPS_V110_OR_X31_FALG_STUFFING = 70, /**< CSD data rate - 4800BPS V110 OR X31 FALG STUFFING */
- TAPI_SAT_BIP_DR_9600BPS_V110_OR_X31_FALG_STUFFING = 71, /**< CSD data rate - 9600BPS V110 OR X31 FALG STUFFING */
- TAPI_SAT_BIP_DR_14400BPS_V110_OR_X31_FALG_STUFFING = 75, /**< CSD data rate - 14400BPS V110 OR X31 FALG STUFFING */
- TAPI_SAT_BIP_DR_19200BPS_V110_OR_X31_FALG_STUFFING = 79, /**< CSD data rate -19200BPS V110 OR X31 FALG STUFFING */
- TAPI_SAT_BIP_DR_28800BPS_V110_OR_X31_FALG_STUFFING = 80, /**< CSD data rate -28800BPS V110 OR X31 FALG STUFFING */
- TAPI_SAT_BIP_DR_38400BPS_V110_OR_X31_FALG_STUFFING = 81, /**< CSD data rate -38400BPS V110 OR X31 FALG STUFFING */
- TAPI_SAT_BIP_DR_48000BPS_V110_OR_X31_FALG_STUFFING = 82, /**< CSD data rate -48000BPS V110 OR X31 FALG STUFFING */
- TAPI_SAT_BIP_DR_56000BPS_V110_OR_X31_FALG_STUFFING = 83, /**< CSD data rate -56000BPS V110 OR X31 FALG STUFFING */
- TAPI_SAT_BIP_DR_64000BPS = 84, /**< CSD data rate -64000BPS */
- TAPI_SAT_BIP_DR_56000BPS_BIT_TRANSPERENT = 115, /**< CSD data rate -56000BPS BIT TRANSPERENT */
- TAPI_SAT_BIP_DR_64000BPS_BIT_TRANSPERENT = 116, /**< CSD data rate -64000BPS BIT TRANSPERENT */
- TAPI_SAT_BIP_DR_32000BPS_PIAFS32K = 120, /**< CSD data rate -32000BPS PIAFS32K */
- TAPI_SAT_BIP_DR_64000BPS_PIAFS64K = 121, /**< CSD data rate - 64000BPS PIAFS64K */
- TAPI_SAT_BIP_DR_28800BPS_MULTIMEDIA = 130, /**< CSD data rate -28800BPS MULTIMEDIA */
- TAPI_SAT_BIP_DR_32000BPS_MULTIMEDIA = 131, /**< CSD data rate -32000BPS MULTIMEDIA */
- TAPI_SAT_BIP_DR_33600BPS_MULTIMEDIA = 132, /**< CSD data rate - 33600BPS MULTIMEDIA */
- TAPI_SAT_BIP_DR_56000BPS_MULTIMEDIA = 133, /**< CSD data rate -56000BPS MULTIMEDIA */
- TAPI_SAT_BIP_DR_64000BPS_MULTIMEDIA = 134 /**< CSD data rate -64000BPS MULTIMEDIA */
-} TelSatBearerParamCsdDataRateType_t;
-
-/**
- * @enum TelSatBearerParamCsdBearerServiceType_t
- * This enum lists the SAT bearer parameter csd bearer service
- */
-typedef enum {
- TAPI_SAT_BIP_CSD_BS_DATA_CIRCUIT_ASYNC_UDI = 0, /**< CSD Bearer service - DATA CIRCUIT ASYNCHRONOUS UDI */
- TAPI_SAT_BIP_CSD_BS_DATA_CIRCUIT_SYNC = 1, /**< CSD Bearer service - DATA CIRCUIT SYNCHRONOUS UDI */
- TAPI_SAT_BIP_CSD_BS_PAD_ACCESS_ASYNC_UDI = 2, /**< CSD Bearer service - PAD ACCESS ASYNCHRONOUS UDI */
- TAPI_SAT_BIP_CSD_BS_PACKET_ACCESS_SYNC = 3, /**< CSD Bearer service - PACKET ACCESS SYNCHRONOUS UDI */
- TAPI_SAT_BIP_CSD_BS_DATA_CIRCUIT_ASYNC_RDI = 4, /**< CSD Bearer service - DATA CIRCUIT ASYNCHRONOUS RDI */
- TAPI_SAT_BIP_CSD_BS_DATA_CIRCUIT_SYNC_RDI = 5, /**< CSD Bearer service - DATA CIRCUIT SYNCHRONOUS RDI */
- TAPI_SAT_BIP_CSD_BS_PAD_ACCESS_ASYNC_RDI = 6, /**< CSD Bearer service - PAD ACCESS ASYNCHRONOUS RDI */
- TAPI_SAT_BIP_CSD_BS_PACKET_ACCESS_SYNC_RDI = 7 /**< CSD Bearer service - PACKET ACCESS SYNCHRONOUS RDI */
-} TelSatBearerParamCsdBearerServiceType_t;
-
-/**
- * @enum TelSatBearerParamCsdConnectionElementType_t
- * This enum lists the SAT bearer parameter csd connection element
- */
-typedef enum {
- TAPI_SAT_BIP_CSD_CONN_ELEM_TRANSPARENT = 0, /**< CSD connection element - TRANSPARENT */
- TAPI_SAT_BIP_CSD_CONN_ELEM_NON_TRANSPARENT = 1, /**< CSD connection element - NON TRANSPARENT */
- TAPI_SAT_BIP_CSD_CONN_ELEM_BOTH_TRANSPARENT_PREF = 2, /**< CSD connection element -BOTH TRANSPARENT PREFFERED */
- TAPI_SAT_BIP_CSD_CONN_ELEM_BOTH_NON_TRANSPARENT_PREF = 3 /**< CSD connection element - NON TRANSPARENT PREFFERED */
-} TelSatBearerParamCsdConnectionElementType_t;
-
-/**
- * @enum TelSatBearerParamGprsPrecedenceClassType_t
- * This enum lists the SAT bearer parameter GPRS precedence class. refer TS 23.107
- */
-typedef enum {
- TAPI_SAT_BIP_GPRS_PRECED_CLASS_HIGH_PRIORITY = 0x01, /**< GPRS precedence class -HIGH PRIORITY */
- TAPI_SAT_BIP_GPRS_PRECED_CLASS_NORM_PRIORITY = 0x02, /**< GPRS precedence class -NORM PRIORITY */
- TAPI_SAT_BIP_GPRS_PRECED_CLASS_LOW_PRIORITY = 0x03 /**< GPRS precedence class - LOW PRIORITY */
-} TelSatBearerParamGprsPrecedenceClassType_t;
-
-/**
- * @enum TelSatBearerParamGprsDelayClassType_t
- * This enum lists the SAT bearer parameter GPRS delay class.
- */
-typedef enum {
- TAPI_SAT_BIP_GPRS_DELAY_CLASS_1 = 0x01, /**< GPRS delay class - 1 */
- TAPI_SAT_BIP_GPRS_DELAY_CLASS_2 = 0x02, /**< GPRS delay class - 2 */
- TAPI_SAT_BIP_GPRS_DELAY_CLASS_3 = 0x03, /**< GPRS delay class - 3 */
- TAPI_SAT_BIP_GPRS_DELAY_CLASS_4 = 0x04 /**< GPRS delay class - 4 */
-} TelSatBearerParamGprsDelayClassType_t;
-
-/**
- * @enum TelSatBearerParamGprsReliabilityClassType_t
- * This enum lists the SAT bearer parameter GPRS Reliability class.
- */
-typedef enum {
- TAPI_SAT_BIP_GPRS_RELIABILITY_CLASS_1 = 0x01, /**< GPRS Reliability class -1 */
- TAPI_SAT_BIP_GPRS_RELIABILITY_CLASS_2 = 0x02, /**< GPRS Reliability class -2 */
- TAPI_SAT_BIP_GPRS_RELIABILITY_CLASS_3 = 0x03, /**< GPRS Reliability class -3 */
- TAPI_SAT_BIP_GPRS_RELIABILITY_CLASS_4 = 0x04, /**< GPRS Reliability class -4 */
- TAPI_SAT_BIP_GPRS_RELIABILITY_CLASS_5 = 0x05 /**< GPRS Reliability class -5 */
-} TelSatBearerParamGprsReliabilityClassType_t;
-
-/**
- * @enum TelSatBearerParamGprsPeakThroughputClassType_t
- * This enum lists the SAT bearer parameter GPRS peak throughput class.
- */
-typedef enum {
- TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_8KBPS = 0x01, /**< GPRS peak throughput class- UPTO 8KBPS */
- TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_16KBPS = 0x02, /**< GPRS peak throughput class- UPTO 16KBPS */
- TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_32KBPS = 0x03, /**< GPRS peak throughput class-UPTO 32KBPS */
- TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_64KBPS = 0x04, /**< GPRS peak throughput class-UPTO 64KBPS */
- TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_128KBPS = 0x05, /**< GPRS peak throughput class- UPTO 128KBPS */
- TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_256KBPS = 0x06, /**< GPRS peak throughput class- UPTO 256KBPS */
- TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_512KBPS = 0x07, /**< GPRS peak throughput class- UPTO 512KBPS */
- TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_1024KBPS = 0x08, /**< GPRS peak throughput class-UPTO 1024KBPS */
- TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_2048KBPS = 0x09 /**< GPRS peak throughput class- UPTO 2048KBPS */
-} TelSatBearerParamGprsPeakThroughputClassType_t;
-
-/**
- * @enum TelSatBearerParamGprsMeanThroughputClassType_t
- * This enum lists the SAT bearer parameter GPRS mean throughput class.
- */
-typedef enum {
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_DOT_22_BPS = 0x01, /**< GPRS mean throughput class - DOT 22 BPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_DOT_44_BPS = 0x02, /**< GPRS mean throughput class - DOT 44 BPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_1_DOT_11_BPS = 0x03, /**< GPRS mean throughput class -1 DOT 11 BPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_2_DOT_2_BPS = 0x04, /**< GPRS mean throughput class -2 DOT 2 BPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_2_DOT_4_BPS = 0x05, /**< GPRS mean throughput class -2 DOT 4 BPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_11_DOT_1_BPS = 0x06, /**< GPRS mean throughput class - 11 DOT 1 BPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_22BPS = 0x07, /**< GPRS mean throughput class -22BPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_44BPS = 0x08, /**< GPRS mean throughput class - 44BPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_111BPS = 0x09, /**< GPRS mean throughput class - 111BPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_DOT_22_KBPS = 0x0A, /**< GPRS mean throughput class - DOT 22 KBPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_DOT_44_KBPS = 0x0B, /**< GPRS mean throughput class -DOT 44 KBPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_1_DOT_11_KBPS = 0x0C, /**< GPRS mean throughput class -1 DOT 11 KBPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_2_DOT_2_KBPS = 0x0D, /**< GPRS mean throughput class -2 DOT 2 KBPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_4_DOT_4_KBPS = 0x0E, /**< GPRS mean throughput class - 4 DOT 4 KBPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_11_DOT_1_KBPS = 0x0F, /**< GPRS mean throughput class -11 DOT 1 KBPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_22KBPS = 0x10, /**< GPRS mean throughput class - 22KBPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_44KBPS = 0x11, /**< GPRS mean throughput class - 44KBPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_111KBPS = 0x12, /**< GPRS mean throughput class -111KBPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_BEST_EFFORT = 0x13 /**< GPRS mean throughput class - BEST EFFORT */
-} TelSatBearerParamGprsMeanThroughputClassType_t;
-
-/**
- * @enum TelSatBearerParamGprsPdpType_t
- * This enum lists the SAT bearer parameter GPRS pdp type.
- */
-typedef enum {
- TAPI_SAT_BIP_GPRS_PDP_TYPE_IP = 0x02, /**< bearer parameter GPRS pdp type - IP */
- TAPI_SAT_BIP_GPRS_PDP_TYPE_RESERVED = 0xff /**< reserved */
-} TelSatBearerParamGprsPdpType_t;
-
-/**
- * @enum TelSatBearerParamLocalLinksServiceIdentityType_t
- * This enum lists the SAT bearer parameters local links service identity.
- */
-typedef enum {
- TAPI_SAT_BIP_LL_SERVICE_IDENT_VALUE_ASSIGNED_BY_USIM = 0x00, /**< local links service identity - value assigned by USIM */
- TAPI_SAT_BIP_LL_SERVICE_IDENT_VALUE_ASSIGNED_BY_REMOTED_DEVICE = 0xFF /**< local links service identity - value assigned by remote service */
-} TelSatBearerParamLocalLinksServiceIdentityType_t;
-
-/**
- * @enum TelSatChannelStatusType_t
- * This enum lists the SAT channel status type.
- */
-typedef enum {
- TAPI_SAT_CS_LINK_ESTABLISHED_OR_PDP_CTX_NOT_ACTIVATED, /**< channel status type-CS LINK ESTABLISHED OR PDP CTX NOT ACTIVATED */
- TAPI_SAT_CS_LINK_ESTABLISHED_OR_PDP_CTX_ACTIVATED, /**< channel status type-CS LINK ESTABLISHED OR PDP CTX ACTIVATED */
- TAPI_SAT_UICC_SERVER_MODE_TCP_IN_CLOSED_STATE, /**< channel status type-UICC SERVER MODE TCP IN CLOSED STATE */
- TAPI_SAT_UICC_SERVER_MODE_TCP_IN_LISTEN_STATE, /**< channel status type-UICC SERVER MODE TCP IN LISTEN STATE */
- TAPI_SAT_UICC_SERVER_MODE_TCP_IN_ESTABLISHED_STATE, /**< channel status type-UICC SERVER MODE TCP IN ESTABLISHED STATE */
- TAPI_SAT_UICC_SERVER_MODE_RESERVED /**< reserved */
-} TelSatChannelStatusType_t;
-
-/**
- * @enum TelSatChannelStatusInfoType_t
- * This enum lists the SAT channel status info type.
- */
-typedef enum {
- TAPI_SAT_CHANNEL_STATUS_NO_FURTHER_INFO_AVAILABLE = 0, /**< CHANNEL STATUS NO FURTHER INFO AVAILABLE */
- TAPI_SAT_CHANNEL_STATUS_NOT_USED = 1, /**< CHANNEL STATUS NOT USED */
- TAPI_SAT_CHANNEL_STATUS_LINK_DROPPED = 5 /**< CHANNEL STATUS LINK DROPPED */
-} TelSatChannelStatusInfoType_t;
-
-/**
- * @enum TelSatAddressType_t
- * This enum lists the SAT address type.
- */
-typedef enum {
- TAPI_SAT_ADDR_TYPE_IPv4 = 0x21, /**< address type - IPv4 */
- TAPI_SAT_ADDR_TYPE_IPv6 = 0x57, /**< address type - IPv6 */
- TAPI_SAT_ADDR_RESERVED = 0xFF /**< reserved */
-} TelSatAddressType_t;
-
-/**
- * @enum TelSatTransportProtocolType_t
- * This enum lists the SAT transport protocol type.
- */
-typedef enum {
- TAPI_SAT_TP_TYPE_UDP_UICC_CLIENT = 0x01, /**< transport protocol type- UDP UICC CLIENT */
- TAPI_SAT_TP_TYPE_TCP_UICC_CLIENT = 0x02, /**< transport protocol type-TCP UICC CLIENT */
- TAPI_SAT_TP_TYPE_TCP_UICC_SERVER = 0x03 /**< transport protocol type- TCP UICC SERVER */
-} TelSatTransportProtocolType_t;
-
-/**
- * @enum TelSatRemoteEntityAddrCodingType_t
- * This enum lists the SAT remote entity address coding type.
- */
-typedef enum {
- TAPI_SAT_REMOTE_ENTITY_ADDR_CODING_TYPE_IEEE802_48BIT = 0, /**< remote entity address coding type- IEEE802 48BIT */
- TAPI_SAT_REMOTE_ENTITY_ADDR_CODING_TYPE_IRDA_32BIT = 1, /**< remote entity address coding type- IRDA 32BIT */
- TAPI_SAT_REMOTE_ENTITY_ADDR_CODING_TYPE_RESERVED = 0xFF /**< reserved */
-} TelSatRemoteEntityAddrCodingType_t;
-
-/**
- * This structure defines the Address data object.
- */
-typedef struct {
- TelSimTypeOfNum_t ton; /**< type of number */
- TelSimNumberingPlanIdentity_t npi; /**< number plan identity */
- unsigned char diallingNumberLen; /**< dialing number length */
- char diallingNumber[TAPI_SAT_DIALLING_NUMBER_LEN_MAX]; /**< dialing number */
-} TelSatAddressInfo_t;
-
-/**
- * This structure defines the data coding scheme object.
- */
-typedef struct {
- int bIsCompressedFormat; /**< flag to verify compressed format */
- TelSatAlphabetFormatType_t alphabetFormat; /**< alphabet format Type */
- TelSatMsgClassType_t msgClass; /**< Type of message class */
- unsigned char rawDcs; /**< raw dcs info */
-} TelSatDataCodingSchemeInfo_t;
-
-/**
- * This structure defines the Alpha ID data object.
- */
-typedef struct {
- int bIsPresent; /**< flag for checking existence of alpha identifier */
- TelSatDataCodingSchemeInfo_t dcs; /**< dcs info */
- unsigned char stringLen; /**< alpha identifier length */
- char string[TAPI_SAT_ALPHA_ID_LEN_MAX]; /**< alpha identifier info */
-} TelSatAlphaIdentifierInfo_t;
-
-/**
- * This structure defines the Sub Address data object.
- */
-typedef struct {
- unsigned char subAddressLen; /**< sub address length */
- char subAddress[TAPI_SAT_SUB_ADDR_LEN_MAX]; /**< sub address */
-} TelSatSubAddressInfo_t;
-
-/**
- * This structure defines the Capability Configuration Parameters data object.
- */
-typedef struct {
- unsigned char dataLen; /**< capability configuration parameter length */
- char data[TAPI_SAT_CCP_DATA_LEN_MAX]; /**< capability configuration parameter */
-} TelSatCapaConfigParamInfo_t;
-
-/**
- * This struct defines the Command qualifier values for send SMS command.
- */
-typedef struct {
- int bIsPackingByMeRequired; /**< flag to verify packing requirement, if FALSE, packing by ME not required */
-} TelSatCmdQualiSendSms_t;
-
-/**
- * This struct defines the Command qualifier values for display text command.
- */
-typedef struct {
- TelSatDisplayTextPriorityType_t msgPriority; /**< message priority */
- TelSatDisplayTextMsgClearType_t msgClear; /**< message clear type */
-} TelSatCmdQualiDisplayText_t;
-
-/**
- * This struct defines the Command qualifier values for get inkey command.
- */
-typedef struct {
- TelSatInkeyType_t inkeyType; /**< inkey type */
- int bIsUsingAlphabetSet; /**< flag for checking whether using alphabet set or not. if FALSE, digits(0-9,*,#and+) only */
- TelSatUseInputAlphabetType_t alphabetType; /**< alphabet type */
- int bIsImmediateResponseRequired;/**< flag for checking whether immediate response required or not */
- int bIsHelpInfoAvailable; /**< flag for checking whether help info available or not. if FALSE, no help information available */
-} TelSatCmdQualiGetInkey_t;
-
-/**
- * This struct defines the Command qualifier values for get input command.
- */
-typedef struct {
- int bIsUsingAlphabetSet; /**< flag for checking whether using alphabet set. if FALSE, digits(0-9,*,#and+) only */
- TelSatUseInputAlphabetType_t alphabetType; /**< alphabet type. only using alphabet set case. */
- int bIsMeEchoUserInput; /**< flag for checking whether ME should echo user input. if FALSE, user input shall not be displayed*/
- int bIsUserInputUnpackedFormat; /**< flag for checking whether user input is in unpacked format or not. if FALSE, user input in SMS packed format */
- int bIsHelpInfoAvailable; /**< flag to verify if help info available or not. if FALSE, no help information available */
-} TelSatCmdQualiGetInput_t;
-
-/**
- * This struct defines the Command qualifier values for play tone command.
- */
-typedef struct {
- TelSatDisplayVibrateAlertType_t vibrateAlert; /**< type of vibrate alert */
-} TelSatCmdQualiPlayTone_t;
-
-/**
- * This struct defines the Command qualifier values for select item command.
- */
-typedef struct {
- TelSatPresentationType_t presentationType; /**< type of presentation. only presentation type specified */
- TelSatSelectionPreferenceType_t selectionPreference; /**< type of selection preference */
- int bIsHelpInfoAvailable; /**< flag for checking whether help info available or not. if FALSE, no help information available */
-} TelSatCmdQualiSelectItem_t;
-
-/**
- * This struct defines the Command qualifier values for setup menu command.
- */
-typedef struct {
- TelSatSelectionPreferenceType_t selectionPreference; /**< type of selection preference */
- int bIsHelpInfoAvailable; /**< flag to verify help info available or not. if FALSE, no help information available */
-} TelSatCmdQualiSetupMenu_t;
-
-/**
- * This struct defines the Command qualifier values for language notification command.
- */
-typedef struct {
- int bSpecificLanguageNotification; /**< flag for specific language notification. if FALSE, non-specific language notification */
-} TelSatCmdQualiLanguageNotification_t;
-
-/**
- * SAT command qualifier open channel
- */
-typedef struct {
- int bIsEstablishImmediateLink; /**< flag whether establishing immediate link or not. if FALSE, on demand link establishment */
- int bIsAutomaticReconnection; /**< flag whether automatic reconnection or not. if FALSE, no automatic reconnection */
- int bIsModeBackground; /**< flag whether background mode or not. */
-} TelSatCmdQualiOpenChannel_t;
-
-/**
- * SAT command qualifier send data
- */
-typedef struct {
- int bIsSendDataImmediately; /**< flag whether to send data immediately or not. if FALSE, store data in Tx buffer*/
-} TelSatCmdQualiSendData_t;
-
-/**
- * This structure contains the command number, type and the qualifier objects of a SATK command.
- */
-typedef struct {
- unsigned char commandNumber; /**< specific command number */
- TelSatCommandType_t commandType; /**< proactive command type */
-
- union {
- TelSatCmdQualiRefresh_t cmdQualiRefresh; /**< refresh command qualifier info */
- TelSatCmdQualiSetupCall_t cmdQualiSetupCall; /**< setup call command qualifier info */
- TelSatCmdQualiSendSms_t cmdQualiSendSms; /**< send sms command qualifier info */
- TelSatCmdQualiDisplayText_t cmdQualiDisplayText; /**< display text command qualifier info */
- TelSatCmdQualiGetInkey_t cmdQualiGetInkey; /**< get inkey command qualifier info */
- TelSatCmdQualiGetInput_t cmdQualiGetInput; /**< get input command qualifier info */
- TelSatCmdQualiPlayTone_t cmdQualiPlayTone; /**< play tone command qualifier info */
- TelSatCmdQualiSelectItem_t cmdQualiSelectItem; /**< select item command qualifier info */
- TelSatCmdQualiSetupMenu_t cmdQualiSetupMenu; /**< setup menu command qualifier info */
- TelSatCmdQualiProvideLocalInfo_t cmdQualiProvideLocalInfo;/**< provide local info command qualifier info */
- TelSatCmdQualiLanguageNotification_t cmdQualiLanguageNotification;/**< language notification command qualifier info */
- TelSatCmdQualiLaunchBrowser_t cmdQualiLaunchBrowser; /**< launch Browser command qualifier info */
- TelSatCmdQualiOpenChannel_t cmdQualiOpenChannel; /**< Open channel command qualifier info */
- TelSatCmdQualiSendData_t cmdQualiSendData; /**< send data command qualifier info */
- } u; /**< Union */
-} TelSatCommandDetailInfo_t;
-
-/**
- * This struct defines the device identity values.
- */
-typedef struct {
- TelSatDeviceIdentitiesTagType_t source; /**< device identity tag for source */
- TelSatDeviceIdentitiesTagType_t destination; /**< device identity for destination */
-} TelSatDeviceIdentitiesInfo_t;
-
-/**
- * This structure defines the Duration data object.
- */
-typedef struct {
- TelSatTimeUnitType_t timeUnit; /**< time units for the duration data */
- unsigned char timeInterval; /**< time interval */
-} TelSatDurationInfo_t;
-
-/**
- * This structure defines the menu item data object.
- */
-typedef struct {
- unsigned char itemId; /**< item identifier */
- unsigned char textLen; /**< text length */
- unsigned char text[TAPI_SAT_ITEM_TEXT_LEN_MAX + 1]; /**< text information */
-} TelSatMenuItemInfo_t;
-
-/**
- * This structure defines the item identifier object.
- */
-typedef struct {
- unsigned char selectedItemIdentifier; /**< selected item identifier */
-} TelSatItemIdentifierInfo_t;
-
-/**
- * This structure defines expected user response length.
- */
-typedef struct {
- unsigned char min; /**< user response length minimum value */
- unsigned char max; /**< user response length maximum value */
-} TelSatRespLenInfo_t;
-
-/**
- * This structure defines RESUlT data object.
- */
-typedef struct {
- TelSatResultType_t generalResult; /**< general result */
- TelSatMeProblemType_t meProblem; /**< additional information on general result */
-} TelSatResultInfo_t;
-
-/**
- * This structure defines RESUlT data object.
- */
-typedef struct {
- TelSatSmsTpduType_t tpduType; /**< SMS TPDU TYPE */
- unsigned char dataLen; /**< SMS TPDU DATA LENGTH */
- unsigned char data[TAPI_SAT_SMS_TPDU_SMS_DATA_LEN_MAX]; /**< SMS TPDU DATA*/
-} TelSatSmsTpduInfo_t;
-
-/**
- * This structure defines SS STRING data object.
- */
-typedef struct {
- TelSimTypeOfNum_t ton; /**< type of number */
- TelSimNumberingPlanIdentity_t npi; /**< number plan identity */
- unsigned char stringLen; /**< ss string length */
- char string[TAPI_SAT_SS_STRING_LEN_MAX]; /**< ss string */
-} TelSatSsStringInfo_t;
-
-/**
- * This structure defines TEXT STRING data object.
- */
-typedef struct {
- int bIsDigitOnly; /**< flag for checking whether only digits used or not */
- TelSatDataCodingSchemeInfo_t dcs; /**< data coding scheme */
- unsigned short stringLen; /**< text length */
- char string[TAPI_SAT_TEXT_STRING_LEN_MAX + 1]; /**< text string */
-} TelSatTextTypeInfo_t;
-
-/**
- * This structure defines menu item text object.
- */
-typedef struct {
- int bIsDigitOnly; /**< flag for checking whether only digits used or not */
- TelSatDataCodingSchemeInfo_t dcs; /**< data coding scheme */
- unsigned char stringLen; /**< menu item string length */
- char* pString; /**< Menu Item String */
-} TelSatMenuItemTextInfo_t;
-
-/**
- * This structure defines tone object.
- */
-typedef struct {
- TelSatToneType_t type; /**< tone type */
-} TelSatToneInfo_t;
-
-/**
- * This structure defines USSD string data object.
- */
-typedef struct {
- TelSatDataCodingSchemeInfo_t dcs; /**< data coding scheme */
- unsigned char ussdStringLen; /**< ussd string length */
- char ussdString[TAPI_SAT_USSD_STRING_LEN_MAX]; /**< ussd string */
-} TelSatUssdStringInfo_t;
-
-/**
- * This structure defines File list data object.
- */
-typedef struct {
- unsigned char fileCount; /**< file count */
-// TelSimFileName_t fileId[TAPI_SAT_FILE_ID_LIST_MAX_COUNT]; /**< file identifier */
-} TelSatFileListInfo_t;
-
-/**
- * This structure defines default text data object.
- */
-typedef struct {
- int bIsPresent; /**< flag for checking whether default text exists or not */
- int bIsDigitOnly; /**< flag for checking whether only digits used or not */
- TelSatDataCodingSchemeInfo_t dcs; /**< data coding scheme */
- unsigned char stringLen; /**< default text string length */
- char string[TAPI_SAT_TEXT_STRING_LEN_MAX]; /**< default text */
-} TelSatDefaultTextInfo_t;
-
-/**
- * This structure defines Next Action Indicator List data object.
- */
-typedef struct {
- unsigned char listCount; /**< next action identifier count */
- unsigned char list[TAPI_SAT_ITEMS_NEXT_ACTION_INDI_LIST_MAX_COUNT]; /**< next action identifier list */
-} TelSatItemsNextActionIndiListInfo_t;
-
-/**
- * This structure defines event list data object.
- */
-typedef struct {
- unsigned char eventListCount; /**< event list count */
- TelSatEventDownloadType_t list[TAPI_SAT_EVENT_LIST_MAX_COUNT]; /**< event list */
-} TelSatEventListInfo_t;
-
-/**
- * This structure defines icon info object.
- */
-typedef struct {
- unsigned char width; /**< icon width */
- unsigned char height; /**< icon height */
- TelSatImageCodingSchemeType_t ics; /**< image coding scheme */
- unsigned short iconDataLen; /**< icon data length */
- unsigned short clutDataLen; /**< clut data length */
- char iconFile[TAPI_SAT_IMG_DATA_FILE_PATH_LEN_MAX];
- char clutFile[TAPI_SAT_IMG_DATA_FILE_PATH_LEN_MAX];
-} TelSatIconInfo_t;
-
-/**
- * This structure defines icon data object.
- */
-typedef struct {
- int bIsPresent; /**< flag for checking whether icon identifier exists or not */
- TelSatIconQualifierType_t iconQualifier; /**< icon qualifier type */
- unsigned char iconIdentifier; /**< icon identifier */
- TelSatIconInfo_t iconInfo; /**< icon info */
-} TelSatIconIdentifierInfo_t;
-
-/**
- * This structure defines icon identifier data object.
- */
-typedef struct {
- int bIsPresent; /**< flag for checking whether icon identifier exists or not */
- TelSatIconQualifierType_t iconListQualifier; /**< icon list qualifier */
- unsigned char iconCount; /**< icon count */
- unsigned char iconIdentifierList[TAPI_SAT_ICON_LIST_MAX_COUNT]; /**< icon identifier list */
- TelSatIconInfo_t iconInfo[TAPI_SAT_ICON_LIST_MAX_COUNT]; /**< icon list info */
-} TelSatIconIdentifierListInfo_t;
-
-/**
- * This structure defines SAT bc repeat indicator Info
- */
-typedef struct {
- TelSatBcRepeatIndicatorType_t indType; /**< bc repeat indicator type */
-} TelSatBcRepeatIndicatorInfo_t;
-
-/**
- * This structure defines call control strings.
- */
-typedef struct {
- TelSatCallCtrlStringType_t callCtrlStringType; /**< call control type */
- union {
- TelSatAddressInfo_t voiceString; /**< voice call string */
- TelSatSsStringInfo_t ssString; /**< ss string */
- TelSatUssdStringInfo_t ussdString; /**< ussd string */
- } u; /**< Union */
-} TelSatCallCtrlAddressStringInfo_t;
-
-/**
- * This structure defines the Action requested call control data.
- */
-typedef struct {
- TelSatCallCtrlAddressStringInfo_t callCtrlAddString; /**< Call control address string */
- TelSatCapaConfigParamInfo_t ccp1; /**< Capability configuration parameter 1 */
- TelSatSubAddressInfo_t subAddress; /**< Subaddress */
- TelSatAlphaIdentifierInfo_t alphaId; /**< Alpha identifier */
- TelSatBcRepeatIndicatorInfo_t bcRepeatIndicator; /**< Bc repeat indicator */
- TelSatCapaConfigParamInfo_t ccp2; /**< Capability configuration parameter 2 */
-} TelSatCallCtrlRequestedActionInfo_t;
-
-/**
- * This structure defines dtmf string data object.
- */
-typedef struct {
- unsigned char stringLen; /**< dtmf string lengh */
- char dtmfTone[TAPI_SAT_DTMF_STRING_LEN_MAX]; /**< dtmf tone data */
-} TelSatDtmfStringInfo_t;
-
-/**
- * This structure defines language data object.
- */
-typedef struct {
- TelSatLanguageType_t language; /**< language type */
-} TelSatLanguageInfo_t;
-
-/**
- * This structure defines date time and time zone data object.
- */
-typedef struct {
- unsigned char year; /**< year */
- unsigned char month; /**< month */
- unsigned char day; /**< day */
- unsigned char hour; /**< hour */
- unsigned char minute; /**< minute */
- unsigned char second; /**< second */
- unsigned char timeZone; /**< timeZone */
-} TelSatDataTimeZoneInfo_t;
-
-/**
- * This structure defines SAT browser identities.
- */
-typedef struct {
- TelSatBrowserIdentityType_t browserIdentity; /**< browser identity */
-} TelSatBrowserIdentitiesInfo_t;
-
-/**
- * This structure defines SAT browser URL Data Object.
- */
-typedef struct {
- char string[TAPI_SAT_URL_LEN_MAX + 1]; /**< url string */
-} TelSatUrlInfo_t;
-
-/**
- * This structure defines SAT bearer type.
- */
-typedef struct {
- unsigned char listLen; /**< bearer list length */
- TelSatBearerType_t bearerList[TAPI_SAT_BEARER_LIST_MAX_COUNT]; /**< bearer list */
-} TelSatBearerInfo_t;
-
-/**
- * This structure defines SAT provisioning reference.
- */
-typedef struct {
- char provisioningFilePath[TAPI_SAT_PROVISIONING_FILE_PATH_LEN_MAX]; /**< provisioning file path */
-} TelSatProvisioningRefInfo_t;
-
-/**
- * This structure defines SAT browser termination cause.
- */
-typedef struct {
- TelSatBrowserTerminationCauseType_t cause; /**< browser termination cause */
-} TelSatBrowserTerminationCauseInfo_t;
-
-/**
- * This structure defines SAT Csd bearer parameters .
- */
-typedef struct {
- TelSatBearerParamCsdDataRateType_t dataRate; /**< bearer csd data rate */
- TelSatBearerParamCsdBearerServiceType_t bearerService; /**< bearer csd service type */
- TelSatBearerParamCsdConnectionElementType_t connectionElement; /**< bearer connection element type */
-} TelSatBearerParametersCsdInfo_t;
-
-/**
- * This structure defines SAT bearer parameters GPRS.
- */
-typedef struct {
- TelSatBearerParamGprsPrecedenceClassType_t precedenceClass; /**< bearer gprs precedence class */
- TelSatBearerParamGprsDelayClassType_t delayClass; /**< bearer gprs delay */
- TelSatBearerParamGprsReliabilityClassType_t reliabilityClass; /**< bearer gprs reliability */
- TelSatBearerParamGprsPeakThroughputClassType_t peakThroughputClass;/**< bearer gprs peak throughput */
- TelSatBearerParamGprsMeanThroughputClassType_t meanThroughputClass;/**< bearer gprs mean throughput */
- TelSatBearerParamGprsPdpType_t pdpType; /**< bearer gprs pdp type */
-} TelSatBearerParametersGprsInfo_t;
-
-/**
- * This structure defines SAT bearer parameters local links.
- */
-typedef struct {
- TelSatBearerParamLocalLinksServiceIdentityType_t serviceIdentifier; /**< bearer local link service identifier */
- char serviceRecord[TAPI_SAT_BEARER_PARAMS_LEN_MAX]; /**< bearer local link service record */
-} TelSatBearerParametersLocalLinksInfo_t;
-
-/**
- * This structure defines SAT bearer description.
- */
-typedef struct {
- TelSatBearerDescType_t bearerType; /**< bearer type */
- union {
- TelSatBearerParametersCsdInfo_t bearerParamsCsd; /**< csd */
- TelSatBearerParametersGprsInfo_t bearerParamsGprs; /**< gprs */
- TelSatBearerParametersLocalLinksInfo_t bearerParamsLocalLinks; /**< local link */
- } bearer_params; /**<Union */
-} TelSatBearerDescriptionInfo_t;
-
-/**
- * This structure defines SAT channel data.
- */
-typedef struct {
- unsigned char channelDataStringLen; /**< channel data length */
- char channelDataString[TAPI_SAT_CHANNEL_DATA_STRING_LEN_MAX]; /**< channel data */
-} TelSatChannelDataInfo_t;
-
-/**
- * This structure defines SAT channel data length.
- */
-typedef struct {
- unsigned char channelDataLen; /**< channel data length */
-} TelSatChannelDataLengthInfo_t;
-
-/**
- * This structure defines SAT buffer size.
- */
-typedef struct {
- unsigned char bufferSize[2]; /**< channel data buffer size */
-} TelSatBufferSizeInfo_t;
-
-/**
- * This structure defines SAT channel status.
- */
-typedef struct {
- unsigned char channelId; /**< channel id */
- TelSatChannelStatusType_t status; /**< channel status */
- TelSatChannelStatusInfoType_t channelInfo; /**< channel status info */
-} TelSatChannelStatusInfo_t;
-
-/**
- * This structure defines SAT other address.
- */
-typedef struct {
- TelSatAddressType_t addressType; /**< channel address type */
- unsigned char addressLen; /**< channel address length */
- char address[TAPI_SAT_OTHER_ADDR_LEN_MAX]; /**< channel address */
-} TelSatOtherAddressInfo_t;
-
-/**
- * This structure defines SIM me interface transport level.
- */
-typedef struct {
- TelSatTransportProtocolType_t transportProtocolType; /**< transport protocol type */
- unsigned short portNumber; /**< port number */
-} TelSatSimMeInterfaceTransportLevelInfo_t;
-
-/**
- * This structure defines SAT network access name.
- */
-typedef struct {
- unsigned char length; /**< network access name length */
- unsigned char netAccName[TAPI_SAT_NET_ACC_NAM_LEN_MAX]; /**< network access name */
-} TelSatnetworkAccessNameInfo_t;
-
-/**
- * This structure defines SAT aid.
- */
-typedef struct {
- char aid[TAPI_SAT_AID_LEN_MAX]; /**< application Id */
-} TelSatAidInfo_t;
-
-/**
- * This structure defines SAT remote entity address.
- */
-typedef struct {
- TelSatRemoteEntityAddrCodingType_t codingType; /**< remote entity address coding type */
- unsigned short length; /**< remote entity address length */
- unsigned char remoteEntityAddress[TAPI_SAT_REMOTE_ENTITY_ADDR_LEN_MAX]; /**< remote entity address data */
-} TelSatRemoteEntityAddressInfo_t;
-
-/**
- * This structure defines SAT text attribute.
- */
-typedef struct {
- unsigned char textFormatting[4]; /**< text attribute -e.g. bold, center align, etc */
-} TelSatTextAttributeInfo_t;
-
-/**
- * This structure defines SAT text attribute list.
- */
-typedef struct {
- unsigned int listCount; /**< text attribute list count */
- TelSatTextAttributeInfo_t list[TAPI_SAT_ITEM_TEXT_ATTRIBUTES_LIST_MAX_COUNT]; /**< text attribute list info */
-} TelSatTextAttributeListInfo_t;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _TEL_SAT_OBJ_H_ */
-
-/**
- * @}
- */
+++ /dev/null
-/*
- * tel-plugin-dbus_tapi
- *
- * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * @open
- * @ingroup TelephonyAPI
- * @addtogroup SAT_TAPI SAT
- * @{
- *
- * @file TelSatProactvCmd.h
-
- @brief This file serves as a "C" header file defines structures for Tapi SAT Proactive commands and terminal response Services. \n
- It contains a sample set of constants, enums, structs that would be required by applications.
- */
-
-#ifndef _TEL_SAT_PROACTV_CMD_H_
-#define _TEL_SAT_PROACTV_CMD_H_
-
-#include <TelSatObj.h>
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-#define TAPI_SAT_MENU_ITEM_COUNT_MAX 40 /**< max count of sat menu items */
-#define TAPI_SAT_PROVISIONING_REF_MAX_COUNT 10 /**< max count of sat provisioning reference */
-
-/**
- * This structure contains the data objects for DISPLAY TEXT proactive command indication.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
-} TelSatMoreTimeIndInfo_t;
-
-/**
- * This structure contains the data objects for DISPLAY TEXT proactive command indication.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatTextTypeInfo_t text; /**< display text info */
- TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */
- int bImmediateRespRequested; /**< flag for checking whether immediate response required or not */
- TelSatDurationInfo_t duration; /**< duration for which text should be displayed */
- TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */
-} TelSatDisplayTextIndInfo_t;
-
-/**
- * This structure contains the data objects for GET INKEY proactive command indication.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatTextTypeInfo_t text; /**< display text info */
- TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */
- TelSatDurationInfo_t duration; /**< duration for which text should be displayed */
- TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */
-} TelSatGetInkeyIndInfo_t;
-
-/**
- * This structure contains the data objects for GET INPUT proactive command indication.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatTextTypeInfo_t text; /**< display text info */
- TelSatRespLenInfo_t respLen; /**< input response length */
- TelSatTextTypeInfo_t defaultText; /**< default text info */
- TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */
- TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */
-} TelSatGetInputIndInfo_t;
-
-/**
- * This structure contains the data objects for PLAY TONE proactive command indication.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */
- TelSatToneInfo_t tone; /**< tone info */
- TelSatDurationInfo_t duration; /**< duration for which tone should be played */
- TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */
- TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */
-} TelSatPlayToneIndInfo_t;
-
-/**
- * This structure contains the data objects for SETUP MENU proactive command indication.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */
- unsigned char menuItemCount; /**< count of menu items */
- TelSatMenuItemInfo_t menuItem[TAPI_SAT_MENU_ITEM_COUNT_MAX]; /**< menu item data */
- TelSatItemsNextActionIndiListInfo_t itemNextActionIndList; /**< next action indication list */
- TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */
- TelSatIconIdentifierListInfo_t iconIdList; /**< icon identifier list info */
- TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */
- TelSatTextAttributeListInfo_t itemTextAttributeList; /**< item text attribute list */
-} TelSatSetupMenuIndInfo_t;
-
-/**
- * This structure contains the data objects for SELECT ITEM proactive command indication data.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */
- TelSatItemsNextActionIndiListInfo_t itemNextActionIndList; /**< next action indication list */
- unsigned char defaultItemIdentifier; /**< default item identifier(default selected item id) */
- TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */
- TelSatIconIdentifierListInfo_t iconIdList; /**< icon identifier list info */
- TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */
- TelSatTextAttributeListInfo_t itemTextAttributeList; /**< item text attribute list */
- unsigned char menuItemCount; /**< count of menu items */
- TelSatMenuItemInfo_t menuItem[TAPI_SAT_MENU_ITEM_COUNT_MAX]; /**< menu item data */
-} TelSatSelectItemIndInfo_t;
-
-/**
- * This structure contains the data objects for SEND SHORT MESSAGE proactive command indication.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */
- TelSatAddressInfo_t address; /**< address for sending sms */
- TelSatSmsTpduInfo_t smsTpdu; /**< sms tpdu info */
- TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */
- TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */
-} TelSatSendSmsIndInfo_t;
-
-/**
- * This structure contains the data objects for SEND SS proactive command indication.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */
- TelSatSsStringInfo_t ssString; /**< ss string */
- TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */
- TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */
-} TelSatSendSsIndInfo_t;
-
-/**
- * This structure contains the data objects for SEND USSD proactive command indication.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */
- TelSatUssdStringInfo_t ussdString; /**< ussd string info */
- TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */
- TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */
-} TelSatSendUssdIndInfo_t;
-
-/**
- * This structure contains the data objects for SETUP CALL proactive command indication.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatAddressInfo_t address; /**< setup call address info*/
- TelSatCapaConfigParamInfo_t ccp; /**< capability configuration parameter */
- TelSatSubAddressInfo_t subAddress; /**< setup call sub address */
- TelSatDurationInfo_t duration; /**< command execution time duration */
- TelSatAlphaIdentifierInfo_t userConfirmPhaseAlphaId;/**< user Confirmation Phase AlphaId */
- TelSatAlphaIdentifierInfo_t callSetupPhaseAlphaId; /**< call Setup Phase AlphaId */
- TelSatIconIdentifierInfo_t userConfirmPhaseIconId; /**< user Confirmation Phase IconId */
- TelSatIconIdentifierInfo_t callSetupPhaseIconId; /**< call Setup Phase IconId */
- TelSatTextAttributeInfo_t userConfirmPhaseTextAttribute; /**< user Confirmation Phase Text Attribute */
- TelSatTextAttributeInfo_t callSetupPhaseTextAttribute; /**< call Setup PhaseText Attribute */
-} TelSatSetupCallIndInfo_t;
-
-/**
- * This structure contains the data objects for REFRESH proactive command indication.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatFileListInfo_t fileList; /**< file list for refresh */
- TelSatAidInfo_t aid; /**< application Id */
-} TelSatRefreshIndInfo_t;
-
-/**
- * This structure contains the data objects for PROVIDE LOCAL INFO proactive command indication.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
-
-} TelSatProvideLocalInfoIndInfo_t;
-
-/**
- * This structure contains the data objects for SETUP EVENT LIST proactive command indication data.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatEventListInfo_t eventList; /**< event list contains events which are required by USIM application */
-
-} TelSatSetupEventListIndInfo_t;
-
-/**
- * This structure contains the data objects for SETUP IDLE MODE TEXT proactive command indication.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatTextTypeInfo_t text; /**< text to be shown on idle screen */
- TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */
- TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */
-} TelSatSetupIdleModeTextIndInfo_t;
-
-/**
- * This structure contains the data objects for SEND DTMF COMMAND proactive command indication.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */
- TelSatDtmfStringInfo_t dtmfString; /**< dtmf string */
- TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */
- TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */
-} TelSatSendDtmfIndInfo_t;
-
-/**
- * This structure contains the data objects for LANGUAGE NOTIFICATION proactive command indication.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatLanguageInfo_t language; /**< language info from USIM application */
-} TelSatLanguageNotificationIndInfo_t;
-
-/**
- * This structure contains the data objects for LAUNCH BROWSER proactive command indication.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatBrowserIdentitiesInfo_t browserId; /**< browser identity */
- TelSatUrlInfo_t url; /**< url */
- TelSatBearerInfo_t bearer; /**< bearer which is used by browser */
- unsigned char provisioningRefCount; /**< provisioning reference count */
- TelSatProvisioningRefInfo_t provisioningRef[TAPI_SAT_PROVISIONING_REF_MAX_COUNT]; /**< provisioning reference data */
- TelSatTextTypeInfo_t text; /**< display text info */
- TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */
- TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */
- TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */
-} TelSatLaunchBrowserIndInfo_t;
-
-/**
- * This structure contains the data objects for OPEN CHANNEL CSB proactive command indication data.
- */
-typedef struct {
- TelSatAddressInfo_t address; /**< channel address */
- TelSatSubAddressInfo_t subAddress; /**< channel sub address */
- TelSatDurationInfo_t duration1; /**< connection require time */
- TelSatDurationInfo_t duration2; /**< connection require time2 */
- TelSatBearerParametersCsdInfo_t bearerParamsCsd; /**< csd info */
- TelSatBufferSizeInfo_t bufferSize; /**< bufferSize */
- TelSatOtherAddressInfo_t otherAddress; /**< otherAddress */
- TelSatTextTypeInfo_t userLogin; /**< userLogin */
- TelSatTextTypeInfo_t userPassword; /**< userPassword */
- TelSatSimMeInterfaceTransportLevelInfo_t simMeInterfaceTransportLevel; /**< simMeInterfaceTransportLevel */
- TelSatOtherAddressInfo_t dataDestinationAddress; /**< dataDestinationAddress */
-} TelSatOpenChannelCsbInfo_t;
-
-/**
- * This structure contains the data objects for OPEN CHANNEL (packet) proactive command indication data.
- */
-typedef struct {
- TelSatBearerParametersGprsInfo_t bearerParamsGprs; /**< gprs info */
- TelSatBufferSizeInfo_t bufferSize; /**< bufferSize */
- TelSatnetworkAccessNameInfo_t networkAccessName; /**< networkAccessName */
- TelSatOtherAddressInfo_t otherAddress; /**< otherAddress */
- TelSatTextTypeInfo_t userLogin; /**< userLogin */
- TelSatTextTypeInfo_t userPassword; /**< userPassword */
- TelSatSimMeInterfaceTransportLevelInfo_t simMeInterfaceTransportLevel; /**< simMeInterfaceTransportLevel */
- TelSatOtherAddressInfo_t dataDestinationAddress; /**< dataDestinationAddress */
- TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */
-} TelSatOpenChannelpdbInfo_t;
-
-/**
- * This structure contains the data objects for OPEN CHANNEL LOCAL LINK proactive command indication data.
- */
-typedef struct {
- TelSatDurationInfo_t duration1; /**< command execution time duration1 */
- TelSatDurationInfo_t duration2; /**< command execution time duration2 */
- TelSatBearerParametersLocalLinksInfo_t bearerParamsLocalLinks; /**< local link info */
- TelSatBufferSizeInfo_t bufferSize; /**< bufferSize */
- TelSatTextTypeInfo_t userPassword; /**< userPassword */
- TelSatSimMeInterfaceTransportLevelInfo_t simMeInterfaceTransportLevel; /**< simMeInterfaceTransportLevel */
- TelSatOtherAddressInfo_t dataDestinationAddress; /**< dataDestinationAddress */
- TelSatRemoteEntityAddressInfo_t remoteEntityAddress; /**< remoteEntityAddress */
- TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */
-} TelSatOpenChannelLocalBearerInfo_t;
-
-/**
- * This structure contains the data objects for OPEN CHANNEL (DEFAULT BEARER) proactive command indication data.
- */
-typedef struct {
- TelSatBufferSizeInfo_t bufferSize; /**< bufferSize */
- TelSatOtherAddressInfo_t otherAddress; /**< otherAddress */
- TelSatTextTypeInfo_t userLogin; /**< userLogin */
- TelSatTextTypeInfo_t userPassword; /**< userPassword */
- TelSatSimMeInterfaceTransportLevelInfo_t simMeInterfaceTransportLevel;/**< simMeInterfaceTransportLevel */
- TelSatOtherAddressInfo_t dataDestinationAddress; /**< dataDestinationAddress */
-} TelSatOpenChannelDefaultBearerInfo_t;
-
-/**
- * This structure contains the data objects for OPEN CHANNEL (UICC Server Mode) proactive command indication data.
- */
-typedef struct {
- TelSatBufferSizeInfo_t bufferSize; /**< bufferSize */
- TelSatSimMeInterfaceTransportLevelInfo_t simMeInterfaceTransportLevel; /**< simMeInterfaceTransportLevel */
-} TelSatOpenChannelUiccServerModeInfo_t;
-
-/**
- * This structure contains the data objects for OPEN CHANNEL proactive command indication data.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- int bIsUiccServerMode; /**< flag whether UICC server mode or not */
- TelSatBearerDescType_t bearerType; /**< bearer destination type */
- TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */
- TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */
- union {
- TelSatOpenChannelCsbInfo_t csBearer; /**< cs info */
- TelSatOpenChannelpdbInfo_t pdBearer; /**< pbd info */
- TelSatOpenChannelLocalBearerInfo_t locBearer; /**< local link info */
- TelSatOpenChannelDefaultBearerInfo_t defaultBearer; /**< defaultBearer */
- TelSatOpenChannelUiccServerModeInfo_t uiccServerMode; /**< uiccServerMode */
- } details; /**< Open Channel Details */
-} TelSatOpenChannelIndInfo_t;
-
-/**
- * This structure contains the data objects for CLOSE CHANNEL proactive command indication data.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */
- TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */
- TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */
-} TelSatCloseChannelIndInfo_t;
-
-/**
- * This structure contains the data objects for RECEIVE DATA proactive command indication data.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */
- TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */
- TelSatChannelDataLengthInfo_t channelDataLen; /**< channel data length */
-} TelSatReceiveDataIndInfo_t;
-
-/**
- * This structure contains the data objects for SEND DATA proactive command indication data.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */
- TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */
- TelSatChannelDataInfo_t channel_data; /**< channel data for sending */
-} TelSatSendDataIndInfo_t;
-
-/**
- * This structure contains the data objects for GET CHANNEL STATUS proactive command indication data.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
-} TelSatGetChannelStatusIndInfo_t;
-
-/**
- * This structure contains the data object for END PROACTIVE SESSION command indication.
- */
-typedef struct {
- TelSatCommandType_t commandType; /**< proactive command type */
-} TelSatEndProactiveSessionIndInfo_t;
-
-/**
- * This structure contains the data objects for PROACTIVE command indication union data.
- */
-typedef struct {
- union {
- TelSatMoreTimeIndInfo_t moreTime;
- TelSatDisplayTextIndInfo_t displayText; /**< Parsed proactive command info from TLV to Telephony data type - display text */
- TelSatGetInkeyIndInfo_t getInkey; /**< Parsed proactive command info from TLV to Telephony data type - getInkey */
- TelSatGetInputIndInfo_t getInput; /**< Parsed proactive command info from TLV to Telephony data type - getInput */
- TelSatPlayToneIndInfo_t playTone; /**< Parsed proactive command info from TLV to Telephony data type - play tone */
- TelSatSetupMenuIndInfo_t setupMenu; /**< Parsed proactive command info from TLV to Telephony data type - setup menu */
- TelSatSelectItemIndInfo_t selectItem; /**< Parsed proactive command info from TLV to Telephony data type - select item */
- TelSatSendSmsIndInfo_t sendSms; /**< Parsed proactive command info from TLV to Telephony data type - send sms */
- TelSatSendSsIndInfo_t sendSs; /**< Parsed proactive command info from TLV to Telephony data type - send ss */
- TelSatSendUssdIndInfo_t sendUssd; /**< Parsed proactive command info from TLV to Telephony data type - send ussd */
- TelSatSetupCallIndInfo_t setupCall; /**< Parsed proactive command info from TLV to Telephony data type - setup call */
- TelSatRefreshIndInfo_t refresh; /**< Parsed proactive command info from TLV to Telephony data type - refresh */
- TelSatProvideLocalInfoIndInfo_t provideLocInfo; /**< Parsed proactive command info from TLV to Telephony data type - provide local info */
- TelSatLaunchBrowserIndInfo_t launchBrowser; /**< Parsed proactive command info from TLV to Telephony data type - launch browser */
- TelSatSetupIdleModeTextIndInfo_t idleText; /**< Parsed proactive command info from TLV to Telephony data type - setup idle mode text */
- TelSatSendDtmfIndInfo_t sendDtmf; /**< Parsed proactive command info from TLV to Telephony data type - send dtmf */
- TelSatLanguageNotificationIndInfo_t languageNotification;/**< Parsed proactive command info from TLV to Telephony data type - language notification */
- TelSatSetupEventListIndInfo_t setupEventList; /**< Parsed proactive command info from TLV to Telephony data type - setup event list */
- TelSatOpenChannelIndInfo_t openChannel; /**< Parsed proactive command info from TLV to Telephony data type - open channel */
- TelSatCloseChannelIndInfo_t closeChannel; /**< Parsed proactive command info from TLV to Telephony data type - close channel */
- TelSatReceiveDataIndInfo_t receiveData; /**< Parsed proactive command info from TLV to Telephony data type - receive data */
- TelSatSendDataIndInfo_t sendData; /**< Parsed proactive command info from TLV to Telephony data type - send data */
- TelSatGetChannelStatusIndInfo_t getChannelStatus; /**< Parsed proactive command info from TLV to Telephony data type - get channel status */
- } cmdInfo; /**< Union */
-} TelSatProactiveCmdData_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of DISPLAY TEXT proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
-} TelSatDisplayTextRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of GET INKEY proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
- TelSatTextTypeInfo_t text; /**< inserted key info */
- TelSatDurationInfo_t duration;
-} TelSatGetInkeyRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of PLAY TONE proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
-} TelSatPlayToneRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of MORE TIME proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
-} TelSatMoreTimeRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of SETUP MENU proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
-} TelSatSetupMenuRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of GET INPUT proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
- TelSatTextTypeInfo_t text; /**< inserted string info */
-} TelSatGetInputRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of SELECT ITEM proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
- int bOtherInfo; /**< flag to check whether other information is required or not */
- unsigned char itemIdentifier; /**< item identifier */
-} TelSatSelectItemRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of PROVIDE LOCAL INFORMATION proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
- int bOtherInfo; /**< flag to check whether other information is required or not */
- TelSatCmdQualiProvideLocalInfo_t infoType; /**< local info type - e.g. time zone or language info, etc */
- union {
- TelSatDataTimeZoneInfo_t timeZoneInfo; /**< current time zone info */
- TelSatLanguageInfo_t languageInfo; /**< current ME language setting info */
- } u; /**< Union */
-} TelSatProvideLocalInfoRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of SETUP EVENT LIST proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
-} TelSatSetupEventListRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of SEND SMS proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
- TelSatCallCtrlProblemType_t additionalCallCtrlProblemInfo; /**< call control problem */
-} TelSatSendSmsRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of SET UP CALL proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
- int bOtherInfo; /**< flag to check whether other information are required or not */
- TelSatNetworkProblemType_t networkProblem; /**< network problem during setup call */
- TelSatCallCtrlProblemType_t permanentCallCtrlProblem; /**< permanent call control problem */
- TelSatCallCtrlRequestedActionInfo_t callCtrlRequestedAction; /**< call control requested action info */
- TelSatResultInfo_t result2; /**< additional response on general result */
- TelSatTextTypeInfo_t text; /**< text string info */
- int bIsTapiCause; /**< flag to check whether tapi makes problem or not */
- unsigned long tapiCause; /**< tapi call level cause */
- unsigned long tapiSsCause; /**< tapi ss level cause */
-} TelSatSetupCallRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of SEND SS proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
- int bOtherInfo; /**< flag to check whether whether other information is required or not */
- TelSatSsProblemType_t additionalSsProblemInfo; /**< additional ss problem */
- TelSatCallCtrlProblemType_t additionalCallCtrlProblemInfo; /**< additional call control problem */
- TelSatCallCtrlRequestedActionInfo_t callCtrlRequestedAction; /**< call control requested action info */
- TelSatResultInfo_t result2; /**< additional response on general result */
- TelSatTextTypeInfo_t text; /**< text string info */
-} TelSatSendSsRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of SEND USSD proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
- int bOtherInfo; /**< flag to check whether other information is required or not */
- TelSatUssdProblemType_t additionalUssdProblemInfo; /**< additional ussd problem */
- TelSatCallCtrlProblemType_t additionalCallCtrlProblemInfo; /**< additional call control problem */
- int bCallCtrlHasModification; /**< flag to check whether modification happens during call control */
- TelSatTextTypeInfo_t text; /**< text string info */
- TelSatCallCtrlRequestedActionInfo_t callCtrlRequestedAction; /**< call control requested action info */
- TelSatResultInfo_t result2; /**< additional response on general result */
- TelSatTextTypeInfo_t text2; /**< text string info */
-} TelSatSendUssdRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of REFRESH proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
-} TelSatRefreshRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of GET CHANNEL STATUS proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
- int bOtherInfo; /**< flag whether other information are required or not */
- TelSatBipProblemType_t additionalProblemInfo; /**< bip specific problem info */
- TelSatChannelStatusInfo_t channelStatus; /**< channel Status */
-} TelSatGetChannelStatusRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of CLOSE CHANNEL proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
- TelSatBipProblemType_t additionalProblemInfo; /**< bip specific problem info */
-} TelSatCloseChannelRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of OPEN CHANNEL proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
- int bOtherInfo; /**< flag whether other information are required or not */
- TelSatBearerDescriptionInfo_t bearerDescription; /**< bearerDescription */
- TelSatBipProblemType_t additionalProblemInfo; /**< bip specific problem info */
- TelSatChannelStatusInfo_t channelStatus; /**< channelStatus */
- TelSatBufferSizeInfo_t bufferSize; /**< bufferSize */
-} TelSatOpenChannelRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of LANGAUGE NOTIFICATION proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
-} TelSatLanguageNotificationRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of LAUNCH BROWSER proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
- TelSatLaunchBrowserProblemType_t additionalProblemInfo; /**< browser specific problem info */
-} TelSatLaunchBrowserRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of RECEIVE DATA proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
- TelSatBipProblemType_t additionalProblemInfo; /**< bip specific problem info */
- int bOtherInfo; /**< flag whether other information are required or not */
- TelSatChannelDataInfo_t channel_data; /**< channel data */
- unsigned char channelDataLen; /**< channel data length */
-} TelSatReceiveDataRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of SEND DATA proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
- TelSatBipProblemType_t additionalProblemInfo; /**< bip specific problem info */
- unsigned char channelDataLen; /**< channel data length */
-} TelSatSendDataRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of SETUP IDLE MODE TEXT proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
-} TelSatSetupIdlemodeTextRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of SEND DTMF proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
-} TelSatSendDtmfRespInfo_t;
-
-/**
- * This contains the data structures to be used to send proactive command response.
- */
-typedef struct {
- unsigned char commandNumber; /**< proactive command number */
- TelSatCommandType_t commandType; /**< proactive command type */
- union {
- TelSatMoreTimeRespInfo_t moreTime;
- TelSatDisplayTextRespInfo_t displayText; /**< terminal response info from displayText proactive command */
- TelSatGetInkeyRespInfo_t getInkey; /**< terminal response info from getInkey proactive command */
- TelSatGetInputRespInfo_t getInput; /**< terminal response info from getInput proactive command */
- TelSatPlayToneRespInfo_t playTone; /**< terminal response info from playTone proactive command */
- TelSatSetupMenuRespInfo_t setupMenu; /**< terminal response info from setupMenu proactive command */
- TelSatSelectItemRespInfo_t selectItem; /**< terminal response info from selectItem proactive command */
- TelSatSendSmsRespInfo_t sendSms; /**< terminal response info from sendSms proactive command */
- TelSatSendSsRespInfo_t sendSs; /**< terminal response info from sendSs proactive command */
- TelSatSendUssdRespInfo_t sendUssd; /**< terminal response info from sendUssd proactive command */
- TelSatSetupCallRespInfo_t setupCall; /**< terminal response info from setupCall proactive command */
- TelSatRefreshRespInfo_t refresh; /**< terminal response info from refresh proactive command */
- TelSatProvideLocalInfoRespInfo_t provideLocInfo; /**< terminal response info from provide Local Info proactive command */
- TelSatLaunchBrowserRespInfo_t launchBrowser; /**< terminal response info from launch Browser proactive command */
- TelSatSetupIdlemodeTextRespInfo_t idleText; /**< terminal response info from setup idle mode text proactive command */
- TelSatSendDtmfRespInfo_t sendDtmf; /**< terminal response info from send Dtmf proactive command */
- TelSatLanguageNotificationRespInfo_t languageNotification; /**< terminal response info from language Notification proactive command */
- TelSatSetupEventListRespInfo_t setupEventList; /**< terminal response info from setup Event List proactive command */
- TelSatOpenChannelRespInfo_t openChannel; /**< terminal response info from openChannel proactive command */
- } terminalRespInfo; /**< Union */
-} TelSatRespInfo_t;
-
-/*
- *SAT Icon Data
- */
-
-typedef struct {
- unsigned char iconId;
- unsigned char imgType;
- unsigned char imgLen;
- unsigned char imgData[256];
-} TelSatIconDataResp_t;
-
-typedef struct {
- unsigned char iconId;
- unsigned char imgType;
- unsigned char fileId[2];
- unsigned char reqDataLen[2];
- unsigned char offset[2];
-} TelsatIconDataGet_t;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _TEL_SAT_PROACTV_CMD_H_ */
-
-/**
- * @}
- */
+++ /dev/null
-/*
- * libslp-tapi
- *
- * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * @open
- * @ingroup TelephonyAPI
- * @addtogroup SIM_TAPI SIM
- * @{
- *
- * @file TelSim.h
-
- @brief This file serves as a "C" header file defines structures for Tapi SIM Services. \n
- It contains a sample set of constants, enums, structs that would be required by applications.
- */
-
-#ifndef _TELSIM_H_
-#define _TELSIM_H_
-
-#include <TelDefines.h>
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/** Maximum ICCID Length */
-#define TAPI_SIM_ICCID_LEN_MAX 20
-
-/** Alpha Id max length */
-#define TAPI_SIM_XDN_ALPHA_ID_MAX_LEN 30
-
-/** Dialing number max length */
-#define TAPI_SIM_XDN_DIALING_NUMBER_LEN 20
-
-/** MSISDN number max length */
-#define TAPI_SIM_MSISDN_DIALING_NUMBER_LEN 26
-
-/** CSP profile entry count max length */
-#define TAPI_SIM_CPHS_CUSTOMER_SERVICE_PROFILE_ENTRY_COUNT_MAX 11
-
-/** Authentication code max length */
-#define TAPI_SIM_AUTH_MAX_REQ_DATA_LEN 256
-
-/** Authentication response data max length */
-#define TAPI_SIM_AUTH_MAX_RESP_DATA_LEN 128
-
-/** SAP APDU max length */
-/** 2048 is for QMI definition. (1024 : general length, 1024 : extra length for additional response) */
-#define TAPI_SIM_APDU_MAX_LEN 2048
-
-/** SIM 3G Phone book EF Max count */
-#define TAPI_SIM_PB_3G_FILE_MAX_COUNT 13
-
-/** SIM Phone book Record name max length */
-#define TAPI_SIM_PB_RECORD_NAME_MAX_LEN 255
-
-/** SIM Phone book Record number max length */
-#define TAPI_SIM_PB_RECORD_NUMBER_MAX_LEN 255
-
-/** SIM Phone book Record email max length */
-#define TAPI_SIM_PB_RECORD_EMAIL_MAX_LEN 255
-
-/** SAP Answer to Reset data max length */
-#define TAPI_SIM_SAP_ATR_DATA 256
-
-#define TAPI_SIM_NET_FULL_NAME_MAX_LEN 40
-
-#define TAPI_SIM_NET_SHORT_NAME_MAX_LEN 10
-
-#define TAPI_SIM_MSP_CNT_MAX 2
-
-#define TAPI_SIM_OPERATION_TIMEOUT 1234
-
-#define TAPI_SIM_SST_SERVICE_CNT_MAX 56
-
-#define TAPI_SIM_UST_SERVICE_CNT_MAX 64
-
-/**
- * @enum TelSimCardType_t
- * This enumeration defines the card type.
- */
-typedef enum {
- TAPI_SIM_CARD_TYPE_UNKNOWN, /**< Unknown card */
- TAPI_SIM_CARD_TYPE_GSM, /**< SIm(GSM) card*/
- TAPI_SIM_CARD_TYPE_USIM, /**< USIM card */
- TAPI_SIM_CARD_TYPE_RUIM,
- TAPI_SIM_CARD_TYPE_IMS,
-} TelSimCardType_t;
-
-/**
- * @enum TelSimFileID_t
- * This enumeration defines the card type.
- */
-typedef enum {
- TAPI_SIM_EF_DIR = 0x2F00, /**< Root Directory for the USIM */
- TAPI_SIM_EF_ICCID = 0x2FE2, /**< the ICC Identification file */
- TAPI_SIM_EF_IMSI = 0x6F07, /**< the IMSI file */
- TAPI_SIM_EF_SST = 0x6F38, /**< the SIM Service Table file */
- TAPI_SIM_EF_EST = 0x6F56, /**< the Enabled Service Table file */
- TAPI_SIM_EF_OPLMN_ACT = 0x6F61, /**< the OPLMN List file*/
- TAPI_SIM_EF_GID1 = 0x6F3E, /**< the Group Identifier Level 1 */
- TAPI_SIM_EF_GID2 = 0x6F3F, /**< the Group Identifier Level 2 */
-
- TAPI_SIM_EF_ELP = 0x2F05, /**< the Extended Language Preference file */
- TAPI_SIM_EF_LP = 0x6F05, /**< SIM: Language preference */
- TAPI_SIM_EF_ECC = 0x6FB7, /**< the Emergency Call Codes */
- TAPI_SIM_EF_SPN = 0x6F46, /**< the Service Provider Name */
- TAPI_SIM_EF_SPDI = 0x6FCD, /**< the Service provider display information*/
- TAPI_SIM_EF_PNN = 0x6FC5, /**< the PLMN Network Name File*/
- TAPI_SIM_EF_OPL = 0x6FC6, /**< the Operator PLMN List File*/
- TAPI_SIM_EF_MSISDN = 0x6F40, /**< MSISDN */
-
- TAPI_SIM_EF_SMS = 0x6F3C, /** < Short Messages file */
- TAPI_SIM_EF_SMSP = 0x6F42, /** < SMS Parameter */
- TAPI_SIM_EF_SMSS = 0x6F43, /** < SMS Status */
- TAPI_SIM_EF_CBMI = 0x6F45, /** < Cell Broadcast Message Identifier */
- TAPI_SIM_EF_MBDN = 0x6FC7, /** < SIM Mail Box Dialing Number file */
-
- TAPI_SIM_EF_USIM_MBI = 0x6FC9, /** < Mailbox Identifier -linear fixed*/
- TAPI_SIM_EF_USIM_MWIS = 0x6FCA, /** < Message Waiting Indication Status -linear fixed*/
- TAPI_SIM_EF_USIM_CFIS = 0x6FCB, /** < Call forward indication status -linear fixed*/
-
- /* CPHS FILE ID */
- TAPI_SIM_EF_CPHS_VOICE_MSG_WAITING = 0x6F11, /** < CPHS voice MSG waiting indication */
- TAPI_SIM_EF_CPHS_SERVICE_STRING_TABLE = 0x6F12, /** < CPHS service string table */
- TAPI_SIM_EF_CPHS_CALL_FORWARD_FLAGS = 0x6F13, /** < CPHS call forward flags */
- TAPI_SIM_EF_CPHS_OPERATOR_NAME_STRING = 0x6F14, /** < CPHS operator name string */
- TAPI_SIM_EF_CPHS_CUSTOMER_SERVICE_PROFILE = 0x6F15, /** < CPHS customer service profile */
- TAPI_SIM_EF_CPHS_CPHS_INFO = 0x6F16, /** < CPHS information */
- TAPI_SIM_EF_CPHS_MAILBOX_NUMBERS = 0x6F17, /** < CPHS mail box numbers */
- TAPI_SIM_EF_CPHS_OPERATOR_NAME_SHORT_FORM_STRING = 0x6F18, /** < CPHS operator name short form string */
- TAPI_SIM_EF_CPHS_INFORMATION_NUMBERS = 0x6F19, /** < CPHS information numbers */
- /* CPHS ALS FILE ID */
- TAPI_SIM_EF_CPHS_DYNAMICFLAGS = 0x6F9F, /** < CPHS Dynamics flags */
- TAPI_SIM_EF_CPHS_DYNAMIC2FLAG = 0x6F92, /** < CPHS Dynamics2 flags */
- TAPI_SIM_EF_CPHS_CUSTOMER_SERVICE_PROFILE_LINE2 = 0x6F98, /** < CPHS CSP2 */
-
- /* Invalid File ID, All the file ID are less than this Value*/
- TAPI_SIM_EF_INVALID = 0xFFFF, /**< Invalid file.*/
- TAPI_SIM_EF_OTHERS, /**< Element to indicate an unknown file.*/
-}TelSimFileID_t;
-
-/**
- * @enum TelSimFacilityStatus_t
- * This enumeration defines the pin status.
- */
-typedef enum {
- TAPI_SIM_FACILITY_DISABLED = 0x00,
- TAPI_SIM_FACILITY_ENABLED = 0x01,
- TAPI_SIM_FACILITY_UNKNOWN = 0xFF
-} TelSimFacilityStatus_t;
-
-/**
- * @enum TelSimPinOperationResult_t
- * This enumeration defines the pin operation result from the lower layers.
- */
-typedef enum {
- TAPI_SIM_PIN_OPERATION_SUCCESS, /**< Operation involving PIN (verification/change/enable/disable, etc) is successful. */
- TAPI_SIM_BUSY, /**< SIM is busy */
- TAPI_SIM_CARD_ERROR, /**< SIM card error - General errors */
- TAPI_SIM_INCOMPATIBLE_PIN_OPERATION, /**< SIM Incompatible pin operation that is in case when invalid SIM command is given or incorrect parameters are supplied to the SIM. */
- TAPI_SIM_PIN_INCORRECT_PASSWORD, /**< SIM PIN Incorrect password */
- TAPI_SIM_PUK_INCORRECT_PASSWORD, /**< SIM PUK Incorrect Password */
- TAPI_SIM_PUK_REQUIRED, /**< PUK Required */
- TAPI_SIM_PIN_REQUIRED, /**< PIN Required */
- TAPI_SIM_NCK_REQUIRED, /**< Network Control Key Required */
- TAPI_SIM_NSCK_REQUIRED, /**< Network Subset Control Key Required */
- TAPI_SIM_SPCK_REQUIRED, /**< Service Provider Control Key Required */
- TAPI_SIM_CCK_REQUIRED, /**< Corporate Control Key Required */
- TAPI_SIM_LOCK_REQUIRED, /**< PH-SIM (phone-SIM) locked state **/
- TAPI_SIM_PERM_BLOCKED /**< Permanently Blocked **/
-} TelSimPinOperationResult_t;
-
-/**
- * @enum TelSimAccessResult_t
- * This enumeration defines the SIM access result from the lower layers.
- */
-typedef enum {
- TAPI_SIM_ACCESS_SUCCESS, /**< Access to file successful. */
- TAPI_SIM_ACCESS_CARD_ERROR, /**< SIM card error */
- TAPI_SIM_ACCESS_FILE_NOT_FOUND, /**< File not found */
- TAPI_SIM_ACCESS_ACCESS_CONDITION_NOT_SATISFIED, /**< Access condition is not fulfilled */
- TAPI_SIM_ACCESS_FAILED, /**< Access failed. */
-} TelSimAccessResult_t;
-
-/**
- * @enum TelSimPinType_t
- * This enumeration defines the pin type.
- */
-typedef enum {
- TAPI_SIM_PTYPE_PIN1 = 0x00, /**< PIN 1 code */
- TAPI_SIM_PTYPE_PIN2 = 0x01, /**< PIN 2 code */
- TAPI_SIM_PTYPE_PUK1 = 0x02, /**< PUK 1 code */
- TAPI_SIM_PTYPE_PUK2 = 0x03, /**< PUK 2 code */
- TAPI_SIM_PTYPE_UPIN = 0x04, /**< Universal PIN - Unused now */
- TAPI_SIM_PTYPE_ADM = 0x05, /**< Administrator - Unused now */
- TAPI_SIM_PTYPE_SIM = 0x06 /**< SIM Lock code */
-} TelSimPinType_t;
-
-/**
- * @enum TelSimTypeOfNum_t
- * This enumeration defines the type of number.
- */
-typedef enum {
- TAPI_SIM_TON_UNKNOWN = 0, /**< unknown */
- TAPI_SIM_TON_INTERNATIONAL = 1, /**< international number */
- TAPI_SIM_TON_NATIONAL = 2, /**< national number */
- TAPI_SIM_TON_NETWORK_SPECIFIC = 3, /**< network specific number */
- TAPI_SIM_TON_DEDICATED_ACCESS = 4, /**< subscriber number */
- TAPI_SIM_TON_ALPHA_NUMERIC = 5, /**< alphanumeric, GSM 7-bit default alphabet) */
- TAPI_SIM_TON_ABBREVIATED_NUMBER = 6, /**< abbreviated number */
- TAPI_SIM_TON_RESERVED_FOR_EXT = 7 /**< reserved for extension */
-} TelSimTypeOfNum_t;
-
-/**
- * @enum TelSimTextEncrypt_t
- * This enumeration defines the text encryption types
- */
-typedef enum {
- TAPI_SIM_TEXT_ENC_ASCII, /**< ASCII Encoding */
- TAPI_SIM_TEXT_ENC_GSM7BIT, /**< GSM 7 Bit Encoding */
- TAPI_SIM_TEXT_ENC_UCS2, /**< UCS2 Encoding */
- TAPI_SIM_TEXT_ENC_HEX, /**< HEX Encoding */
-} TelSimTextEncrypt_t;
-
-/**
- * @enum TelSimNumberingPlanIdentity_t
- * This enumeration defines the numbering plan identifier.
- */
-typedef enum {
- TAPI_SIM_NPI_UNKNOWN = 0, /**< Unknown */
- TAPI_SIM_NPI_ISDN_TEL = 1, /**< ISDN/Telephone numbering plan */
- TAPI_SIM_NPI_DATA_NUMBERING_PLAN = 3, /**< Data numbering plan */
- TAPI_SIM_NPI_TELEX = 4, /**< Telex numbering plan */
- TAPI_SIM_NPI_SVC_CNTR_SPECIFIC_PLAN = 5, /**< Service Center Specific plan */
- TAPI_SIM_NPI_SVC_CNTR_SPECIFIC_PLAN2 = 6, /**< Service Center Specific plan */
- TAPI_SIM_NPI_NATIONAL = 8, /**< National numbering plan */
- TAPI_SIM_NPI_PRIVATE = 9, /**< Private numbering plan */
- TAPI_SIM_NPI_ERMES_NUMBERING_PLAN = 10, /**< ERMES numbering plan */
- TAPI_SIM_NPI_RESERVED_FOR_EXT = 0xF /**< Reserved for extension */
-} TelSimNumberingPlanIdentity_t;
-
-/**
- * @enum TelSimEccEmergencyServiceInfo_t
- * This enumeration defines the emergency service type.
- */
-typedef enum {
- TAPI_SIM_ECC_ESC_POLICE = 0x01, /**< Police */
- TAPI_SIM_ECC_ESC_AMBULANCE = 0x02, /**< Ambulance */
- TAPI_SIM_ECC_ESC_FIREBRIGADE = 0x04, /**< Fire brigade */
- TAPI_SIM_ECC_ESC_MARAINEGUARD = 0x08, /**< Marine guard */
- TAPI_SIM_ECC_ESC_MOUTAINRESCUE = 0x10, /**< Mountain rescue */
- TAPI_SIM_ECC_ESC_SPARE = 0x00 /**< Spare */
-} TelSimEccEmergencyServiceInfo_t;
-
-/**
- * @enum TelSimLanguagePreferenceCode_t
- * This enumeration defines the language indication code.
- */
-typedef enum {
- TAPI_SIM_LP_GERMAN = 0x00, /**< German */
- TAPI_SIM_LP_ENGLISH = 0x01, /**< English */
- TAPI_SIM_LP_ITALIAN = 0x02, /**< Italian */
- TAPI_SIM_LP_FRENCH = 0x03, /**< French */
- TAPI_SIM_LP_SPANISH = 0x04, /**< Spanish */
- TAPI_SIM_LP_DUTCH = 0x05, /**< Dutch */
- TAPI_SIM_LP_SWEDISH = 0x06, /**< Swedish */
- TAPI_SIM_LP_DANISH = 0x07, /**< Danish */
- TAPI_SIM_LP_PORTUGUESE = 0x08, /**< Portuguese */
- TAPI_SIM_LP_FINNISH = 0x09, /**< Finnish */
- TAPI_SIM_LP_NORWEGIAN = 0x0A, /**< Norwegian */
- TAPI_SIM_LP_GREEK = 0x0B, /**< Greek */
- TAPI_SIM_LP_TURKISH = 0x0C, /**< Turkish */
- TAPI_SIM_LP_HUNGARIAN = 0x0D, /**< Hungarian */
- TAPI_SIM_LP_POLISH = 0x0E, /**< Polish */
- TAPI_SIM_LP_KOREAN = 0x0F, /**< Korean */
- TAPI_SIM_LP_CHINESE = 0x10, /**< Chinese */
- TAPI_SIM_LP_RUSSIAN = 0x11, /**< Russian */
- TAPI_SIM_LP_JAPANESE = 0x12, /**< Japanese */
- TAPI_SIM_LP_LANG_UNSPECIFIED = 0xFF /**< Unspecified */
-} TelSimLanguagePreferenceCode_t;
-
-/**
- * @enum TelSimCardStatus_t
- * This enumeration defines the SIM card status
- */
-typedef enum {
- TAPI_SIM_STATUS_CARD_ERROR = 0x00, /**< Bad card / On the fly SIM gone bad **/
- TAPI_SIM_STATUS_CARD_NOT_PRESENT = 0x01, /**< Card not present **/
- TAPI_SIM_STATUS_SIM_INITIALIZING = 0x02, /**< SIM is Initializing state **/
- TAPI_SIM_STATUS_SIM_INIT_COMPLETED = 0x03, /**< SIM Initialization ok **/
- TAPI_SIM_STATUS_SIM_PIN_REQUIRED = 0x04, /**< PIN required state **/
- TAPI_SIM_STATUS_SIM_PUK_REQUIRED = 0x05, /**< PUK required state **/
- TAPI_SIM_STATUS_CARD_BLOCKED = 0x06, /**< PIN/PUK blocked(permanently blocked- All the attempts for PIN/PUK failed) **/
- TAPI_SIM_STATUS_SIM_NCK_REQUIRED = 0x07, /**< Network Control Key required state **/
- TAPI_SIM_STATUS_SIM_NSCK_REQUIRED = 0x08, /**< Network Subset Control Key required state **/
- TAPI_SIM_STATUS_SIM_SPCK_REQUIRED = 0x09, /**< Service Provider Control Key required state **/
- TAPI_SIM_STATUS_SIM_CCK_REQUIRED = 0x0a, /**< Corporate Control Key required state **/
- TAPI_SIM_STATUS_CARD_REMOVED = 0x0b, /**< Card removed **/
- TAPI_SIM_STATUS_SIM_LOCK_REQUIRED = 0x0c, /**< PH-SIM (phone-SIM) locked state **/
- TAPI_SIM_STATUS_CARD_CRASHED = 0x0d, /**< Runtime SIM card error **/
- TAPI_SIM_STATUS_UNKNOWN = 0xff /**< Unknown status. It can be initial status **/
-} TelSimCardStatus_t;
-
-/**
- * @enum TelSimCphsPhaseType_t
- * This enum gives the current CPHS phase of SIM card.
- */
-typedef enum {
- TAPI_SIM_CPHS_PHASE1 = 0x01, /**< phase1 */
- TAPI_SIM_CPHS_PHASE2 = 0x02, /**< phase2 */
- TAPI_SIM_CPHS_PHASE_RFU = 0xff /**< RFU */
-} TelSimCphsPhaseType_t;
-
-/**
- * @enum TelSimCphsIndexLevelIndicator_t
- * This struct gives CPHS index level indication.
- */
-typedef enum {
- TAPI_SIM_CPHS_INDEX_LEVEL_ONE = 0x01, /**< SIM cphs index level one */
- TAPI_SIM_CPHS_INDEX_LEVEL_TWO = 0x02, /**< SIM cphs index level two */
- TAPI_SIM_CPHS_INDEX_LEVEL_THREE = 0x03, /**< SIM cphs index level three */
- TAPI_SIM_CPHS_INDEX_LEVEL_RFU = 0xff /**< SIM cphs index level rfu */
-} TelSimCphsIndexLevelIndicator_t;
-
-/**
- * @enum TelSimCphsCustomerServiceGroup_t
- * This struct gives CPHS group service type information .
- */
-typedef enum {
- TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CALL_OFFERING = 0x01, /**< Group csp offering*/
- TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CALL_RESTRICTION = 0x02, /**< Group csp restriction*/
- TAPI_SIM_CPHS_CSP_SERVICE_GROUP_OTHER_SUPP_SERVICES = 0x03, /**< Group csp supplementary services*/
- TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CALL_COMPLETION = 0x04, /**< Group csp completion*/
- TAPI_SIM_CPHS_CSP_SERVICE_GROUP_TELESERVICES = 0x05, /**< Group csp teleservices*/
- TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CPHS_TELESERVICES = 0x06, /**< Group csp cphs teleservies*/
- TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CPHS_FEATURES = 0x07, /**< Group csp cphs features*/
- TAPI_SIM_CPHS_CSP_SERVICE_GROUP_NUMBER_IDENTIFIERS = 0x08, /**< Group csp number identifiers*/
- TAPI_SIM_CPHS_CSP_SERVICE_GROUP_PHASE_SERVICES = 0x09, /**< Group csp phase services*/
- TAPI_SIM_CPHS_CSP_SERVICE_GROUP_VALUE_ADDED_SERVICES = 0xC0, /**< Group csp value added services*/
- TAPI_SIM_CPHS_CSP_SERVICE_GROUP_INFORMATION_NUMBERS = 0xD5 /**< Group csp information numbers*/
-} TelSimCphsCustomerServiceGroup_t;
-
-/**
- * @enum TelSimMailboxType_t
- * This enum gives mailbox type.
- */
-typedef enum {
- TAPI_SIM_MAILBOX_VOICE = 0x01, /**< Voicemail*/
- TAPI_SIM_MAILBOX_FAX = 0x02, /**< Fax*/
- TAPI_SIM_MAILBOX_EMAIL = 0x03, /**< Email*/
- TAPI_SIM_MAILBOX_OTHER = 0x04, /**< Other*/
- TAPI_SIM_MAILBOX_VIDEO = 0x05, /**< Videomail*/
- TAPI_SIM_MAILBOX_DATA = 0x06, /**< Data*/
-} TelSimMailboxType_t;
-
-/**
- * @enum TelSimDynamicFlagsSelectedLineId_t
- * This enum gives dynamics flag selected line information.
- */
-typedef enum {
- TAPI_SIM_DYNAMIC_FLAGS_LINE1 = 0x01, /**< line 1 */
- TAPI_SIM_DYNAMIC_FLAGS_LINE2 = 0x00, /**< line 2*/
- TAPI_SIM_DYNAMIC_FLAGS_RFU = 0xff /**< rfu*/
-} TelSimDynamicFlagsSelectedLineId_t;
-
-/**
- * @enum tapi_sim_dynamic2_flag_als_status_t
- * This enum gives dynamics2 flag selected line information.
- */
-typedef enum {
- TAPI_SIM_PIN2_ACCESSIBLE_FLAGS_LOCKED = 0x01, /**< Dynamic flags locked */
- TAPI_SIM_PIN2_ACCESSIBLE_FLAGS_UNLOCKED = 0x00, /**< Dynamic flags unlocked */
- TAPI_SIM_PIN2_ACCESSIBLE_FLAGS_RFU = 0xff /**< rfu */
-} TelSimDynamic2FlagAlsStatus_t;
-
-
-/**
- * @enum TelSimAuthenticationType_t
- * This is used for Authentication Procedure by using SIM.
- */
-typedef enum {
- TAPI_SIM_AUTH_TYPE_IMS = 0x00, /**< IMS Authentication */
- TAPI_SIM_AUTH_TYPE_GSM, /**< GSM Authentication */
- TAPI_SIM_AUTH_TYPE_3G, /**< 3G Authentication */
- TAPI_SIM_AUTH_TYPE_MAX /**< TBD */
-} TelSimAuthenticationType_t;
-
-/**
- * @enum TelSimAuthenticationResult_t
- * This is used for Authentication Procedure.
- */
-typedef enum {
- TAPI_SIM_AUTH_NO_ERROR = 0x00, /**< ISIM no error */
- TAPI_SIM_AUTH_CANNOT_PERFORM, /**< status - can't perform authentication */
- TAPI_SIM_AUTH_SKIP_RESPONSE, /**< status - skip authentication response */
- TAPI_SIM_AUTH_MAK_CODE_FAILURE, /**< status - MAK(Multiple Activation Key) code failure */
- TAPI_SIM_AUTH_SQN_FAILURE, /**< status - SQN(SeQuenceNumber) failure */
- TAPI_SIM_AUTH_SYNCH_FAILURE, /**< status - synch failure */
- TAPI_SIM_AUTH_UNSUPPORTED_CONTEXT, /**< status - unsupported context */
- TAPI_SIM_AUTH_MAX /**< TBD */
-} TelSimAuthenticationResult_t;
-
-/**
- * @enum TelSimLockType_t
- * This structure gives security lock type enum values
- */
-typedef enum {
- TAPI_SIM_LOCK_PS = 0x01, /** < PH-SIM (phone-SIM) locked.Lock Phone to SIM/UICC card
- * (MT asks password when other than current SIM/UICC card inserted;
- * MT may remember certain amount of previously used cards thus not
- * requiring password when they are inserted
- */
- TAPI_SIM_LOCK_PF, /** < PH-FSIM (phone-first-SIM) Lock Phone to the very
- * First inserted SIM/UICC card(MT asks password when other than the first SIM/UICC
- * card is inserted
- */
- TAPI_SIM_LOCK_SC, /** < SIM Lock (PIN, PIN2, PUK, PUK2) Lock SIM/UICC card ( SIM asks password in ME power-up and
- * when this command is issued
- */
- TAPI_SIM_LOCK_FD, /** < FDN - SIM card or active application in the UICC (GSM or USIM)
- * fixed dialing memory feature */
- TAPI_SIM_LOCK_PN, /**< Network Personalization */
- TAPI_SIM_LOCK_PU, /** < network subset Personalization */
- TAPI_SIM_LOCK_PP, /** < service Provider Personalization */
- TAPI_SIM_LOCK_PC, /** < Corporate Personalization */
-} TelSimLockType_t;
-
-/**
- * @enum TelSimLockKey_t
- * This structure gives security lock key information enum values
- */
-typedef enum {
- TAPI_SIM_LOCK_KEY_NOT_NEED = 0x00, /**< key not need */
- TAPI_SIM_LOCK_KEY_PIN = 0x01, /**< PIN required */
- TAPI_SIM_LOCK_KEY_PUK = 0x02, /**< PUK required */
- TAPI_SIM_LOCK_KEY_PIN2 = 0x03, /**< PIN2 required */
- TAPI_SIM_LOCK_KEY_PUK2 = 0x04, /**< PUK2 required */
- TAPI_SIM_LOCK_PERM_BLOCKED = 0x05, /**< Permanent block SIM */
-} TelSimLockStatus_t;
-
-/**
- * @enum TelSimSapPowerMode_t
- * This enum gives the SAP message Ids between SAP client and SAP server.
- */
-typedef enum {
- TAPI_SIM_SAP_POWER_SIM_ON_REQ, /**< SAP Client request about power SIM on in Server */
- TAPI_SIM_SAP_POWER_SIM_OFF_REQ, /**< SAP Client request about power SIM off in Server */
- TAPI_SIM_SAP_RESET_SIM_REQ, /**< SAP Client request about SIM reset in Server */
-} TelSimSapPowerMode_t;
-
-/**
- * @enum TelSimSapConnectionStatus_t
- * This enum gives the SAP connection status information .
- */
-typedef enum {
- TAPI_SIM_SAP_CONNECTION_STATUS_OK = 0x00, /**< connect successfully */
- TAPI_SIM_SAP_CONNECTION_STATUS_UNABLE_TO_ESTABLISH, /**< unable to establish connection */
- TAPI_SIM_SAP_CONNECTION_STATUS_NOT_SUPPORT_MAX_SIZE, /**< when server does not support message length that client want send */
- TAPI_SIM_SAP_CONNECTION_STATUS_TOO_SMALL_MAX_SIZE /**< when client want to connect with very small message length which is not supported by Server */
-} TelSimSapConnectionStatus_t;
-
-/**
- * @enum TelSimSapDissconnectType_t
- * This enum gives the SAP disconnect type information.
- */
-typedef enum {
- TAPI_SIM_SAP_DISCONNECT_TYPE_GRACEFUL = 0x00, /**< disconnection procedure ends after finishing current work */
- TAPI_SIM_SAP_DISCONNECT_TYPE_IMMEDIATE /**< disconnection procedure ends immediately*/
-} TelSimSapDissconnectType_t;
-
-/**
- * @enum TelSimSapStatusInfo_t
- * This enum gives the SAP current connection status information
- */
-typedef enum {
- TAPI_SIM_SAP_STATUS_UNKNOWN = 0x00, /**< SAP server connection status - unknown*/
- TAPI_SIM_SAP_STATUS_NO_SIM, /**< SAP server connection status - no SIM*/
- TAPI_SIM_SAP_STATUS_NOT_READY, /**< SAP server connection status - not ready*/
- TAPI_SIM_SAP_STATUS_READY, /**< SAP server connection status - ready*/
- TAPI_SIM_SAP_STATUS_CONNECTED /**< SAP server connection status - connected*/
-} TelSimSapStatusInfo_t;
-
-/**
- * @enum TelSimSapCardStatus_t
- * This enum gives the SIM card status if server`s status changed about connection with subscription module
- */
-typedef enum {
- TAPI_SIM_SAP_CARD_STATUS_UNKNOWN = 0x00, /**< SAP server status(card reader status) - unknown*/
- TAPI_SIM_SAP_CARD_STATUS_RESET, /**< SAP server status(card reader status) - reset*/
- TAPI_SIM_SAP_CARD_STATUS_NOT_ACCESSIBLE, /**< SAP server status(card reader status) - not accessible*/
- TAPI_SIM_SAP_CARD_STATUS_REMOVED, /**< SAP server status(card reader status) - removed*/
- TAPI_SIM_SAP_CARD_STATUS_INSERTED, /**< SAP server status(card reader status) - inserted*/
- TAPI_SIM_SAP_CARD_STATUS_RECOVERED /**< SAP server status(card reader status) - recovered*/
-} TelSimSapCardStatus_t;
-
-/**
- * @enum TelSimSapResultCode_t
- * This enum gives the SAP result information.
- */
-typedef enum {
- TAPI_SIM_SAP_RESULT_CODE_OK = 0x00, /**< SAP operation result - ok*/
- TAPI_SIM_SAP_RESULT_CODE_NO_REASON, /**< SAP operation result - no reason*/
- TAPI_SIM_SAP_RESULT_CODE_CARD_NOT_ACCESSIBLE, /**< SAP operation result - not accessible*/
- TAPI_SIM_SAP_RESULT_CODE_CARD_ALREADY_POWER_OFF, /**< SAP operation result - card already power off*/
- TAPI_SIM_SAP_RESULT_CODE_CARD_REMOVED, /**< SAP operation result - card removed*/
- TAPI_SIM_SAP_RESULT_CODE_CARD_ALREADY_POWER_ON, /**< SAP operation result - card already power on*/
- TAPI_SIM_SAP_RESULT_CODE_DATA_NOT_AVAILABLE, /**< SAP operation result - data not available*/
- TAPI_SIM_SAP_RESULT_CODE_NOT_SUPPORT /**< SAP operation result - not support*/
-} TelSimSapResultCode_t;
-
-/**
- * @enum TelSimSapProtocol_t
- * This enum gives SAP transport protocol type
- */
-typedef enum {
- TAPI_SIM_SAP_PROTOCOL_T0, /**< T = 0, character*/
- TAPI_SIM_SAP_PROTOCOL_T1 /**< T = 1, block*/
-} TelSimSapProtocol_t;
-
-/**
- * @enum TelSimPbAccessResult_t
- * This enumeration defines the Phone book access result
- */
-typedef enum {
- TAPI_SIM_PB_SUCCESS, /**< SIM phonebook operation successful. */
- TAPI_SIM_PB_FAIL, /**< SIM phonebook operation failure. */
- TAPI_SIM_PB_INVALID_INDEX, /**< The index passed was not a valid index. */
- TAPI_SIM_PB_INVALID_NUMBER_LENGTH, /**< The number length is exceeds the max length allowed (or 0). */
- TAPI_SIM_PB_INVALID_NAME_LENGTH, /**< The name length is exceeds the max length allowed (or 0). */
- TAPI_SIM_PB_ACCESS_CONDITION_NOT_SATISFIED, /**< Access condition for PB file is not satisfied. */
-} TelSimPbAccessResult_t;
-
-/**
- * @enum TelSimPbFileType_t
- * This enumeration defines different storage types to be selected in SIM or USIM
- */
-typedef enum {
- TAPI_SIM_PB_FDN, /**< Fixed Dialing Number */
- TAPI_SIM_PB_ADN, /**< SIM - ADN */
- TAPI_SIM_PB_SDN, /**< Service Dialing Number */
- TAPI_SIM_PB_3GSIM, /**< USIM - 3G phone book */
- TAPI_SIM_PB_AAS, /**< Additional number Alpha String */
- TAPI_SIM_PB_GAS, /**< Grouping identifier Alpha String */
- TAPI_SIM_PB_UNKNOWNN = 0xFF, /**< Unknown file type */
-} TelSimPbType_t;
-
-/**
- * @enum TelSimPb3GFileType_t
- * This enumeration defines the different storage field types in 3G Phone book.
- */
-typedef enum {
- /* for 3G phone storage field type */
- TAPI_PB_3G_NAME = 0x01, /**< Name */
- TAPI_PB_3G_NUMBER, /**< Number */
- TAPI_PB_3G_ANR1, /**< First Another number*/
- TAPI_PB_3G_ANR2, /**< Second Another number */
- TAPI_PB_3G_ANR3, /**< Third Another number */
- TAPI_PB_3G_EMAIL1, /**< First Email */
- TAPI_PB_3G_EMAIL2, /**< Second Email */
- TAPI_PB_3G_EMAIL3, /**< Third Email */
- TAPI_PB_3G_EMAIL4, /**< Fourth Email */
- TAPI_PB_3G_SNE, /**< Second name entry of main name*/
- TAPI_PB_3G_GRP, /**< Group */
- TAPI_PB_3G_PBC, /** <1 byte control info and 1 byte hidden info*/
-} TelSimPb3GFileType_t;
-
-/**
- * @enum TelSimSSTService_t
- * This enumeration defines the list of SST services in SIM Service Table. (GSM)
- */
-typedef enum {
- // service 1 ~ 8
- TAPI_SIM_SST_CHV1_DISABLE_FUNC = 0, /**< CHV1 disable function */
- TAPI_SIM_SST_ADN, /**< abbreviated Dialing number */
- TAPI_SIM_SST_FDN, /**< fixed Dialing number */
- TAPI_SIM_SST_SMS, /**< short message storage */
- TAPI_SIM_SST_AOC, /**< advice of charge */
- TAPI_SIM_SST_CCP, /**< capability configuration parameters */
- TAPI_SIM_SST_PLMN_SELECTOR, /**< plmn selector */
- TAPI_SIM_SST_RFU1, /**< rfu */
-
- // service 9 ~ 16
- TAPI_SIM_SST_MSISDN = 8, /**< msisdn */
- TAPI_SIM_SST_EXT1, /**< extension1 */
- TAPI_SIM_SST_EXT2, /**< extension2 */
- TAPI_SIM_SST_SMS_PARAMS, /**< sms parameteres */
- TAPI_SIM_SST_LND, /**< last number dialed */
- TAPI_SIM_SST_CELL_BROADCAST_MSG_ID, /**< cell broadcast message identifier */
- TAPI_SIM_SST_GID_LV1, /**< group identifier level 1 */
- TAPI_SIM_SST_GID_LV2, /**< group identifier level 2 */
-
- // service 17 ~ 24
- TAPI_SIM_SST_SPN = 16, /**< service provider name */
- TAPI_SIM_SST_SDN, /**< service Dialing number */
- TAPI_SIM_SST_EXT3, /**< extension3 */
- TAPI_SIM_SST_RFU2, /**< rfu */
- TAPI_SIM_SST_VGCS_GID_LIST, /**< vgcs group identifier (EF-VGCS, EF-VGCSS) */
- TAPI_SIM_SST_VBS_GID_LIST, /**< vbs group identifier (EF-VBS, EF-VBSS) */
- TAPI_SIM_SST_ENHANCED_MULTI_LV_PRECEDENCE_PREEMPTION_SRVC, /**< enhanced multi-level precedence and pre-emption service */
- TAPI_SIM_SST_AUTO_ANSWER_FOR_EMLPP, /**< automatic answer fro eMLPP */
-
- // service 25 ~ 32,
- TAPI_SIM_SST_DATA_DOWNLOAD_VIA_SMS_CB = 24, /**< data download via sms-cb */
- TAPI_SIM_SST_DATA_DOWNLOAD_VIA_SMS_PP, /**< data download via sms-pp */
- TAPI_SIM_SST_MENU_SELECTION, /**< menu selection */
- TAPI_SIM_SST_CALL_CTRL, /**< call control */
- TAPI_SIM_SST_PROACTIVE_SIM, /**< proactive sim command */
- TAPI_SIM_SST_CELL_BROADCAST_MSG_ID_RANGES, /**< cell broadcast message identifier ranges */
- TAPI_SIM_SST_BDN, /**< barred Dialing numbers */
- TAPI_SIM_SST_EXT4, /**< extension 4 */
-
- // service 33 ~ 40
- TAPI_SIM_SST_DEPERSONALIZATION_CTRL_KEYS = 32, /**< de-personalization control keys */
- TAPI_SIM_SST_COOPERATIVE_NETWORK_LIST, /**< co-operative network list */
- TAPI_SIM_SST_SMS_STATUS_REPORTS, /**< short message status reports */
- TAPI_SIM_SST_NIA, /**< network's indication of alerting in the MS (NIA) */
- TAPI_SIM_SST_MO_SMS_CTRL_BY_SIM, /**< mobile-originated short message control by sim */
- TAPI_SIM_SST_GPRS, /**< gprs */
- TAPI_SIM_SST_IMG, /**< image */
- TAPI_SIM_SST_SOLSA, /**< support of local service area */
-
- // service 41 ~ 48
- TAPI_SIM_SST_USSD_STR_DATA_OBJECT_SUPPORTED_IN_CALL_CTRL = 40, /**< ussd string data object supported in call control */
- TAPI_SIM_SST_RUN_AT_CMD_CMD, /**< RUN AT COMMAND command */
- TAPI_SIM_SST_USER_CTRLED_PLMN_SELECTOR_WACT, /**< user controlled PLMN selector with Access technology */
- TAPI_SIM_SST_OPERATOR_CTRLED_PLMN_SELECTOR_WACT, /**< operator controlled PLMN selector with Access technology */
- TAPI_SIM_SST_HPLMN_SELECTOR_WACT, /**< HPLMN selector with access technology */
- TAPI_SIM_SST_CPBCCH_INFO, /**< CPBCCH information */
- TAPI_SIM_SST_INVESTIGATION_SCAN, /**< investigation scan */
- TAPI_SIM_SST_EXTENDED_CAPA_CONF_PARAMS, /**< extended capability configuration parameters */
-
- // service 49 ~ 56
- TAPI_SIM_SST_MEXE = 48, /**< MExE */
- TAPI_SIM_SST_RPLMN_LAST_USED_ACCESS_TECH, /**< RPLMN last used access technology */
- TAPI_SIM_SST_PLMN_NETWORK_NAME, /*PLMN Network Name*/
- TAPI_SIM_SST_OPERATOR_PLMN_LIST, /*Operator PLMN List*/
- TAPI_SIM_SST_MBDN, /*Mailbox Dialling Numbers*/
- TAPI_SIM_SST_MWIS, /*Message Waiting Indication Status*/
- TAPI_SIM_SST_CFIS, /*Call Forwarding Indication Status*/
- TAPI_SIM_SST_SPDI, /*Service Provider Display Information*/
-} TelSimSSTService_t;
-
-/**
- * @enum TelSimUSTService_t
- * This enumeration defines the list of UST services in SIM Service Table. (USIM)
- */
-typedef enum {
- // service 1 ~ 8
- TAPI_SIM_UST_LOCAL_PB = 0, /**< local phone book */
- TAPI_SIM_UST_FDN, /**< fixed Dialing number */
- TAPI_SIM_UST_EXT2, /**< extension2 */
- TAPI_SIM_UST_SDN, /**< service Dialing number */
- TAPI_SIM_UST_EXT3, /**< extension3 */
- TAPI_SIM_UST_BDN, /**< barred Dialing numbers */
- TAPI_SIM_UST_EXT4, /**< extension 4 */
- TAPI_SIM_UST_OUTGOING_CALL_INFO, /**< outgoing call information */
-
- // service 9 ~ 16
- TAPI_SIM_UST_INCOMING_CALL_INFO = 8, /**< incoming call information */
- TAPI_SIM_UST_SMS, /**< short message storage */
- TAPI_SIM_UST_SMS_STATUS_REPORTS, /**< short message status reports */
- TAPI_SIM_UST_SMS_PARAMS, /**< sms parameteres */
- TAPI_SIM_UST_AOC, /**< advice of charge */
- TAPI_SIM_UST_CCP, /**< capability configuration parameters */
- TAPI_SIM_UST_CELL_BROADCAST_MSG_ID, /**< cell broadcast message identifier */
- TAPI_SIM_UST_CELL_BROADCAST_MSG_ID_RANGES, /**< cell broadcast message identifier ranges */
-
- // service 17 ~ 24
- TAPI_SIM_UST_GID_LV1 = 16, /**< group identifier level 1 */
- TAPI_SIM_UST_GID_LV2, /**< group identifier level 2 */
- TAPI_SIM_UST_SPN, /**< service provider name */
- TAPI_SIM_UST_USER_CTRLED_PLMN_SELECTOR_WACT, /**< user controlled PLMN selector with Access technology */
- TAPI_SIM_UST_MSISDN, /**< msisdn */
- TAPI_SIM_UST_IMG, /**< image */
- TAPI_SIM_UST_SOLSA, /**< support of local service area */
- TAPI_SIM_UST_ENHANCED_MULTI_LV_PRECEDENCE_PREEMPTION_SRVC, /**< enhanced multi-level precedence and pre-emption service */
-
- // service 25 ~ 32
- TAPI_SIM_UST_AUTO_ANSWER_FOR_EMLPP = 24, /**< automatic answer fro eMLPP */
- TAPI_SIM_UST_RFU1, /**< rfu */
- TAPI_SIM_UST_GSM_ACCESS, /**< gsm access */
- TAPI_SIM_UST_DATA_DOWNLOAD_VIA_SMS_PP, /**< data download via sms-pp */
- TAPI_SIM_UST_DATA_DOWNLOAD_VIA_SMS_CB, /**< data download via sms-cb */
- TAPI_SIM_UST_CALL_CTRL, /**< call control by usim*/
- TAPI_SIM_UST_MO_SMS_CTRL, /**< mobile-originated short message control by usim */
- TAPI_SIM_UST_RUN_AT_CMD_CMD, /**< RUN AT COMMAND command */
-
- // service 33 ~ 40
- TAPI_SIM_UST_SHALL_BE_SET_TO_ONE = 32, /**< shall be set to 1 */
- TAPI_SIM_UST_ENABLED_SRVC_TABLE, /**< enabled service table */
- TAPI_SIM_UST_ACL, /**< APN control list */
- TAPI_SIM_UST_DEPERSONALIZATION_CTRL_KEYS, /**< de-personalization control keys */
- TAPI_SIM_UST_COOPERATIVE_NETWORK_LIST, /**< co-operative network list */
- TAPI_SIM_UST_GSM_SEC_CONTEXT, /**< gsm security context */
- TAPI_SIM_UST_CPBCCH_INFO, /**< CPBCCH information */
- TAPI_SIM_UST_INVESTIGATION_SCAN, /**< investigation scan */
-
- // service 41 ~ 48
- TAPI_SIM_UST_MEXE = 40, /**< MExE */
- TAPI_SIM_UST_OPERATOR_CTRLED_PLMN_SELECTOR_WACT, /**< operator controlled PLMN selector with Access technology */
- TAPI_SIM_UST_HPLMN_SELECTOR_WACT, /**< HPLMN selector with access technology */
- TAPI_SIM_UST_EXT5, /**< extension 5 */
- TAPI_SIM_UST_PLMN_NETWORK_NAME, /*PLMN Network Name*/
- TAPI_SIM_UST_OPERATOR_PLMN_LIST, /*Operator PLMN List*/
- TAPI_SIM_UST_MBDN, /*Mailbox Dialling Numbers*/
- TAPI_SIM_UST_MWIS, /*Message Waiting Indication Status*/
-
- // service 49 ~ 56
- TAPI_SIM_UST_CFIS = 48, /*Call Forwarding Indication Status*/
- TAPI_SIM_UST_RPLMN_LAST_USED_ACCESS_TECH, /**< RPLMN last used access technology */
- TAPI_SIM_UST_SPDI, /*Service Provider Display Information*/
- TAPI_SIM_UST_MMS, /**< multi media messaging service */
- TAPI_SIM_UST_EXT8, /**< extension 8 */
- TAPI_SIM_UST_CALL_CTRL_ON_GPRS, /**< call control on gprs by usim */
- TAPI_SIM_UST_MMS_USER_CONNECTIVITY_PARAMS, /**< mms user connectivity parameters */
- TAPI_SIM_UST_NIA, /**< network's indication of alerting in the MS (NIA) */
-
- // service 57 ~ 64
- TAPI_SIM_UST_VGCS_GID_LIST = 56, /**< vgcs group identifier List (EF-VGCS, EF-VGCSS) */
- TAPI_SIM_UST_VBS_GID_LIST, /**< vbs group identifier List (EF-VBS, EF-VBSS) */
- TAPI_SIM_UST_PSEUDONYM,
- TAPI_SIM_UST_USER_CTRLED_PLMN_SELECTOR_IWLAN, /**< user controlled PLMN selector for I-WLAN access */
- TAPI_SIM_UST_OPERATOR_CTRLED_PLMN_SELECTOR_IWLAN, /**< operator controlled PLMN selector for I-WLAN access */
- TAPI_SIM_UST_USER_CTRLED_WSID_LIST,
- TAPI_SIM_UST_OPERATOR_CTRLED_WSID_LIST,
- TAPI_SIM_UST_VGCS_SEC,
-} TelSimUSTService_t;
-
-typedef struct {
- char service[TAPI_SIM_SST_SERVICE_CNT_MAX]; // should access with 'enum TelSimSSTService_t' as index
-} TelSimSST_t;
-
-typedef struct {
- char service[TAPI_SIM_UST_SERVICE_CNT_MAX]; // should access with 'enum TelSimUSTService_t' as index
-} TelSimUST_t;
-
-typedef struct {
- TelSimCardType_t sim_type;
- union {
- TelSimSST_t sst;
- TelSimUST_t ust;
- } table;
-} TelSimServiceTable_t;
-
-/**
- * This data structure defines the data for the Imsi information.
- */
-typedef struct {
- char szMcc[3 + 1]; /**< mobile country code */
- char szMnc[3 + 1]; /**< mobile network code */
- char szMsin[10 + 1]; /**< mobile station identification number */
-} TelSimImsiInfo_t;
-
-typedef struct {
- char name[30+1];
- char number[6+1];
- TelSimEccEmergencyServiceInfo_t category;
-}TelSimEcc_t;
-
-typedef struct {
- int ecc_count;
- TelSimEcc_t list[15];
-}TelSimEccList_t;
-
-typedef struct {
- int icc_length; /**< Integrated Circuit Card number length */
- char icc_num[TAPI_SIM_ICCID_LEN_MAX]; /**< Integrated Circuit Card number */
-} TelSimIccIdInfo_t;
-
-typedef struct {
- int b_cphs;
- int rec_index; /**< index which stands for the location where record is saved in SIM*/
- int profile_num; /**< SIM profile index*/
- TelSimMailboxType_t mb_type;
- int alpha_id_max_len; /**< alpha max length in SIM - READ ONLY*/
- char alpha_id[TAPI_SIM_XDN_ALPHA_ID_MAX_LEN + 1]; /**< Alpha Identifier */
- TelSimTypeOfNum_t ton; /**< Type Of Number */
- TelSimNumberingPlanIdentity_t npi; /**< Number Plan Identity */
- char num[TAPI_SIM_XDN_DIALING_NUMBER_LEN + 1]; /**< Dialing Number/SSC String */
- unsigned char cc_id; /**< Capability/Configuration Identifier */
- unsigned char ext1_id; /**< Extensiion1 Record Identifier */
-}TelSimMailBoxNumber_t;
-
-typedef struct {
- int count;
- TelSimMailBoxNumber_t list[TAPI_SIM_MSP_CNT_MAX*5]; //max is 10
-}TelSimMailboxList_t;
-
-typedef struct {
- int rec_index;
- unsigned char msp_num; /**< MSP number*/
- unsigned char cfu_status; /**< call forwarding unconditional indication status*/
- TelSimTypeOfNum_t ton; /**< TON*/
- TelSimNumberingPlanIdentity_t npi; /**< NPI*/
- char cfu_num[TAPI_SIM_XDN_DIALING_NUMBER_LEN + 1];/**< Dialing Number/SSC String*/
- unsigned char cc2_id; /**< Capability/Configuration2 Record Identifier */
- unsigned char ext7_id; /**< Extension 7 Record Identifier */
-}TelSimCfis_t;
-
-typedef struct {
- int profile_count;
- TelSimCfis_t cf[TAPI_SIM_MSP_CNT_MAX];
-}TelSimCfisList_t;
-
-typedef struct {
- int b_line1; /**< CallForwardUnconditionalLine 1 */
- int b_line2; /**< CallForwardUnconditionalLine 2 */
- int b_fax; /**< CallForwardUnconditional FAX */
- int b_data; /**<CallForwardUnconditional data*/
-}TelSimCphsCf_t;
-
-typedef struct {
- int b_cphs;
- TelSimCfisList_t cf_list;
- TelSimCphsCf_t cphs_cf;
-}TelSimCallForwardingResp_t;
-
-typedef struct {
- int b_cphs;
- union {
- TelSimCfis_t cf;
- TelSimCphsCf_t cphs_cf;
- } cf_data_u;
-}TelSimCallForwardingReq_t;
-
-typedef struct {
- int rec_index;
- unsigned char indicator_status; /**< Indicator Type*/
- int voice_count; /**< VoiceMail Count*/
- int fax_count; /**< FAX Count*/
- int email_count; /**< Email Count*/
- int other_count; /**< Other Count*/
- int video_count; /**< VideoMail Count*/
-}TelSimMwis_t;
-
-typedef struct {
- int profile_count;
- TelSimMwis_t mw[TAPI_SIM_MSP_CNT_MAX];
-}TelSimMwisList_t;
-
-typedef struct {
- int b_voice1; /**< VoiceMsgLine1 message waiting flag */
- int b_voice2; /**< VoiceMsgLine2 message waiting flag */
- int b_fax; /**< FAX message waiting flag */
- int b_data; /**< Data message waiting flag */
-}TelSimCphsMw_t;
-
-typedef struct {
- int b_cphs;
- TelSimMwisList_t mw_list;
- TelSimCphsMw_t cphs_mw;
-}TelSimMessageWaitingResp_t;
-
-typedef struct {
- int b_cphs;
- union {
- TelSimMwis_t mw;
- TelSimCphsMw_t cphs_mw;
- } mw_data_u;
-}TelSimMessageWaitingReq_t;
-
-/**
- * This data structure represents MSISDN information
- */
-typedef struct {
- char num[TAPI_SIM_MSISDN_DIALING_NUMBER_LEN + 1]; /**< MSISDN number. If not exist, Null string will be returned*/
- char name[TAPI_SIM_XDN_ALPHA_ID_MAX_LEN + 1]; /**< MSISDN name. If not exist, Null string will be returned*/
-} TelSimSubscriberInfo_t;
-
-typedef struct {
- int count;
- TelSimSubscriberInfo_t list[3]; //max is 3
-}TelSimMsisdnList_t;
-
-typedef struct {
- char plmn[6+1];
- int b_umts;
- int b_gsm;
-}TelSimOplmnwact_t;
-
-typedef struct {
- int count;
- TelSimOplmnwact_t list[30]; //max is 30
-}TelSimOplmnwactList_t;
-
-typedef struct {
- unsigned char display_condition; /**< display condition (1 byte) */
- unsigned char spn[TAPI_SIM_NET_FULL_NAME_MAX_LEN + 1]; /**< SPN */
-}TelSimSpn_t;
-
-typedef struct {
- unsigned char full_name[TAPI_SIM_NET_FULL_NAME_MAX_LEN + 1];
- unsigned char short_name[TAPI_SIM_NET_SHORT_NAME_MAX_LEN + 1];
-}TelSimCphsNetName_t;
-
-/**
- *This is used for authentication request procedure.
- */
-typedef struct {
- TelSimAuthenticationType_t auth_type; /**< Authentication type */
- int rand_length; /**< the length of RAND */
- int autn_length; /**< the length of AUTN. it is not used in case of GSM AUTH */
- char rand_data[TAPI_SIM_AUTH_MAX_REQ_DATA_LEN]; /**< RAND data */
- char autn_data[TAPI_SIM_AUTH_MAX_REQ_DATA_LEN]; /**< AUTN data. it is not used in case of GSM AUTH */
-} TelSimAuthenticationData_t;
-
-/**
- * This is used for result data of authentication.
- */
-typedef struct {
- TelSimAuthenticationType_t auth_type; /**< authentication type */
- TelSimAuthenticationResult_t auth_result; /**< authentication result */
- int resp_length; /**< response length. IMS and 3G case, it stands for RES_AUTS. GSM case, it stands for SRES. */
- char resp_data[TAPI_SIM_AUTH_MAX_RESP_DATA_LEN]; /**< response data. IMS and 3G case, it stands for RES_AUTS. GSM case, it stands for SRES. */
- int authentication_key_length; /**< the length of authentication key, Kc*/
- char authentication_key[TAPI_SIM_AUTH_MAX_RESP_DATA_LEN]; /**< the data of of authentication key, Kc*/
- int cipher_length; /**< the length of cipher key length */
- char cipher_data[TAPI_SIM_AUTH_MAX_RESP_DATA_LEN]; /**< cipher key */
- int integrity_length; /**< the length of integrity key length */
- char integrity_data[TAPI_SIM_AUTH_MAX_RESP_DATA_LEN]; /**< integrity key */
-} TelSimAuthenticationResponse_t;
-
-
-/**
- * This structure contains information about pin data.
- * SIM PIN DATA. For PIN handling (Change, UnBlock) & for Type of PIN information.
- */
-typedef struct {
- TelSimPinType_t type; /**< Pin type */
- unsigned char* pw; /**< PIN code */
- unsigned int pw_len; /**< PIN code length*/
-} TelSimSecPw_t;
-
-/**
- * This data structure defines the data for the PIN Information.
- */
-typedef struct {
- TelSimPinType_t type; /**< Specifies the PIN or PUK type.*/
- int retry_count; /**< Number of attempts remaining for PIN/PUK verification.*/
-} TelSimSecResult_t;
-
-/**
- * This structure is used to en/disable facility
- */
-typedef struct {
- TelSimLockType_t lock_type; /**< Facility type */
- unsigned char *pw; /**< password */
- int pw_len; /**< password length */
-} TelSimFacilityPw_t;
-
-typedef struct {
- TelSimLockType_t type; /**< Specifies the PIN or PUK type.*/
- int retry_count; /**< Number of attempts remaining for PIN/PUK verification.*/
-} TelSimFacilityResult_t;
-
-typedef struct {
- TelSimLockType_t type;
- TelSimFacilityStatus_t f_status;
-}TelSimFacilityInfo_t;
-
-/**
- *
- * This structure is used to get information about LOCK_TYPE
- */
-typedef struct {
- TelSimLockType_t lock_type; /**< Lock type */
- TelSimLockStatus_t lock_status; /**< Lock key */
- int retry_count; /**< retry counts */
-} TelSimLockInfo_t;
-
-/**
- * This data structure defines the data for the apdu.
- */
-typedef struct {
- unsigned short apdu_len;
- unsigned char* apdu;
-} TelSimApdu_t;
-
-/**
- * This data structure defines the data for the Response of sending apdu.
- */
-typedef struct {
- unsigned short apdu_resp_len;
- unsigned char apdu_resp[TAPI_SIM_APDU_MAX_LEN];
-} TelSimApduResp_t;
-
-/**
- * This data structure defines the data for the Response of sending apdu.
- */
-typedef struct {
- unsigned short atr_resp_len;
- unsigned char atr_resp[TAPI_SIM_APDU_MAX_LEN];
-} TelSimAtrResp_t;
-
-/**
- * This sturcture gives information of available optional CPHS SIM files.
- */
-typedef struct {
- /* Byte 2 - bit1 & 2*/
- int bCustomerServiceProfile; /**< Customer Service Profile (CSP) */
- /* Byte 2 - bit3 & 4*/
- int bServiceStringTable; /**< Service String Table (SST) */
- /* Byte 2 - bit5 & 6*/
- int bMailBoxNumbers; /**< MailBoxNumbers */
- /* Byte 2 - bit7 & 8*/
- int bOperatorNameShortForm; /**< Short form of operator name */
- /* Byte 3 - bit1 & 2*/
- int bInformationNumbers; /**< Information numbers */
-} TelSimCphsServiceTable_t;
-
-/*
- These requirements are additional to the GSM 900 and DCS1800 recommendations.
- They apply to all products which are to be compliant with the CPHS specification.
-
- In addition to those SIM storage fields previously defined in DCS1800 to support
- existing MS features and services, the Association has defined the following fields :-
-
- 1) Call Forwarding flag (mandatory)
- 2) Voice message waiting flag (mandatory)
- 3) PLMN operator name (mandatory)
- 4) Customer Service Profile (CSP) (optional)
- 5) CPHS Information (mandatory)
- 6) Mailbox Numbers (optional)
- 7) Information Numbers (optional)
-
- */
-
-/*
- DATA FIELD - 6F 16: CPHS INFORMATION
- Access Conditions:
- READ CHV1
- UPDATE ADM
- */
-/**
- *
- *This structure gives CPHS information data.
- */
-typedef struct {
- TelSimCphsPhaseType_t CphsPhase; /**< CPHS phase type */
- TelSimCphsServiceTable_t CphsServiceTable; /**< CPHS service table */
-} TelSimCphsInfo_t;
-
-/*
- DATA FIELD -6F 19: Information Numbers
- Access Conditions:
- READ CHV1
- UPDATE CHV1
- */
-/**
- * This struct gives CPHS information numbers data.
- */
-typedef struct {
- int bUsed; /**< SIM CPHS index level one */
- unsigned char AlphaIdLength; /**< length of alpha identifier */
-
- TelSimCphsIndexLevelIndicator_t IndexLevelIndicator; /**< SIM CPHS index level one */
- int PremiumServiceIndicator; /**< SIM CPHS index level one */
- int NetworkSpecificIndicator; /**< SIM CPHS index level one */
- unsigned char Alpha_id[TAPI_SIM_XDN_ALPHA_ID_MAX_LEN + 1]; /**< Alpha Identifier */
-
- unsigned long DiallingnumLength; /**< Length of BCD number/SSC contents */
- TelSimTypeOfNum_t TypeOfNumber; /**< TON */
- TelSimNumberingPlanIdentity_t NumberingPlanIdentity; /**< NPI */
- char DiallingNum[TAPI_SIM_XDN_DIALING_NUMBER_LEN + 1]; /**< dialing Number/SSC String */
- unsigned char Ext1RecordId; /**< Extensiion1 Record Identifier */
-} TelSimCphsInformationNum_t;
-
-/*
- DATA FIELD- 6F 15: Customer Service Profile (Storing a list of service options which are relevant to that specific customer)
- Access Conditions:
- READ CHV1
- UPDATE CHV1
- */
-/**
- *
- * This struct gives CPHS service call offering information.
- */
-typedef struct {
- int bCallForwardingUnconditional; /**< CallForwarding Unconditional */
- int bCallForwardingOnUserBusy; /**< CallForwarding On UserBusy */
- int bCallForwardingOnNoReply; /**< CallForwarding On NoReply */
- int bCallForwardingOnUserNotReachable; /**< CallForwarding On User Not Reachable */
- int bCallTransfer; /**< Call Transfer */
-} TelSimCphsServiceCallOffering_t;
-
-/**
- *
- * This struct gives CPHS service call restriction information.
- */
-typedef struct {
- int bBarringOfAllOutgoingCalls; /**< Barring Of All Outgoing Calls*/
- int bBarringOfOutgoingInternationalCalls; /**< Barring Of Outgoing International Calls */
- int bBarringOfOutgoingInternationalCallsExceptHplmn; /**< Barring Of Outgoing International Calls Except HPLMN */
- int bBarringOfAllIncomingCallsRoamingOutsideHplmn; /**< Barring Of All Incoming Calls Roaming Outside HPLMN */
- int bBarringOfIncomingCallsWhenRoaming; /**< Barring Of IncomingCalls When Roaming */
-} TelSimCphsServiceCallRestriction_t;
-
-/**
- *
- * This struct gives CPHS service SS information.
- */
-typedef struct {
- int bMultiPartyService; /**< MultiPartyService*/
- int bClosedUserGroup; /**< ClosedUserGroup*/
- int bAdviceOfCharge; /**< AdviceOfCharge*/
- int bPreferentialClosedUserGroup; /**< PreferentialClosedUserGroup*/
- int bClosedUserGroupOutgoingAccess; /**< ClosedUserGroupOutgoingAccess*/
-} TelSimCphsServiceOtherSupplimentaryService_t;
-
-/**
- *
- * This struct gives CPHS service call complete information.
- */
-typedef struct {
- int bCallHold; /**< Call Hold*/
- int bCallWaiting; /**< Call Waiting*/
- int bCompletionOfCallToBusySubscriber; /**< Completion Of Call To Busy Subscriber*/
- int bUserUserSignalling; /**< User User Signaling*/
-} TelSimCphsServiceCallComplete_t;
-
-/**
- *
- * This struct gives CPHS service teleservices information.
- */
-typedef struct {
- int bShortMessageMobileOriginated; /**< Short Message Mobile Originated*/
- int bShortMessageMobileTerminated; /**< Short Message Mobile Terminated*/
- int bShortMessageCellBroadcast; /**< Short Message Cell Broadcast*/
- int bShortMessageReplyPath; /**< Short Message Reply Path*/
- int bShortMessageDeliveryConf; /**< Short Message Delivery Conf*/
- int bShortMessageProtocolIdentifier; /**< Short Message Protocol Identifier*/
- int bShortMessageValidityPeriod; /**< Short Message Validity Period*/
-} TelSimCphsServiceTeleservices_t;
-
-/**
- *
- * This struct gives CPHS alternative line service information.
- */
-typedef struct {
- int bAlternativeLineService; /**< Alternative Line Service*/
-} TelSimCphsServiceCphsTeleservices_t;
-
-/**
- *
- * This struct gives CPHS string service table information.
- */
-typedef struct {
- int bStringServiceTable; /**< String Service Table*/
-} TelSimCphsServiceCphsFeatures_t;
-
-/**
- *
- * This struct gives CPHS service number identifier information.
- */
-typedef struct {
- int bCallingLineIdentificationPresent; /**< Calling Line Identification Present*/
- int bConnectedLineIdentificationRestrict; /**< Connected Line Identification Restrict*/
- int bConnectedLineIdentificationPresent; /**< Connected Line Identification Present*/
- int bMaliciousCallIdentifier; /**< Malicious Call Identifier*/
- int bCallingLineIdentificationSend; /**< Calling Line Identification Send*/
- int bCallingLineIdentificationBlock; /**< Calling Line Identification Block*/
-} TelSimCphsServiceNumberIdentifier_t;
-
-/**
- *
- * This struct gives CPHS service phase services information.
- */
-typedef struct {
- int bMenuForGprs; /**< Menu For GPRS*/
- int bMenuForHighSpeedCsd; /**< Menu For HighSpeedCsd*/
- int bMenuForVoiceGroupCall; /**< Menu For VoiceGroupCall*/
- int bMenuForVoiceBroadcastService; /**< Menu For VoiceBroadcastService*/
- int bMenuForMultipleSubscriberProfile; /**< Menu For MultipleSubscriberProfile*/
- int bMenuForMultipleBand; /**< Menu For MultipleBand*/
-} TelSimCphsServicePhaseServices_t;
-
-/**
- *
- * This struct gives CPHS value added service information.
- */
-typedef struct {
- int bRestrictMenuForManualSelection; /**< RestrictMenu For ManualSelection*/
- int bRestrictMenuForVoiceMail; /**< RestrictMenu For VoiceMail*/
- int bRestrictMenuForMoSmsAndPaging; /**< RestrictMenu For MoSmsAndPaging*/
- int bRestrictMenuForMoSmsWithEmialType; /**< RestrictMenu For MoSmsWithEmialType*/
- int bRestrictMenuForFaxCalls; /**< RestrictMenu For FaxCalls*/
- int bRestrictMenuForDataCalls; /**< RestrictMenu For DataCalls*/
- int bRestrictMenuForChangeLanguage; /**< RestrictMenu For ChangeLanguage*/
-} TelSimCphsServiceValueAddedServices_t;
-
-/**
- *
- * This struct gives CPHS service information number data.
- */
-typedef struct {
- int bInformationNumbers; /**< Information Numbers*/
-} TelSimCphsServiceInformationNumbers_t;
-
-/**
- *
- * This struct gives CPHS service profile entry information.
- */
-typedef struct {
- TelSimCphsCustomerServiceGroup_t CustomerServiceGroup; /**< customer service group*/
- union {
- TelSimCphsServiceCallOffering_t CallOffering; /**< call offering*/
- TelSimCphsServiceCallRestriction_t CallRestriction; /**< call restriction*/
- TelSimCphsServiceOtherSupplimentaryService_t OtherSuppServices; /**< other SS services*/
- TelSimCphsServiceCallComplete_t CallComplete; /**< call complete*/
- TelSimCphsServiceTeleservices_t Teleservices; /**< teleservices*/
- TelSimCphsServiceCphsTeleservices_t CphsTeleservices; /**< CPHS teleservices*/
- TelSimCphsServiceCphsTeleservices_t CphsFeatures; /**< CPHS features*/
- TelSimCphsServiceNumberIdentifier_t NumberIdentifiers; /**< number identifiers*/
- TelSimCphsServicePhaseServices_t PhaseServices; /**< phase services*/
- TelSimCphsServiceValueAddedServices_t ValueAddedServices; /**< value added services*/
- TelSimCphsServiceInformationNumbers_t InformationNumbers; /**< information numbers*/
- } u;
-} TelSimCphsCustomerServiceProfileEntry_t;
-
-/**
- *
- * This struct gives CPHS service profile information.
- */
-typedef struct {
- TelSimCphsCustomerServiceProfileEntry_t ServiceProfileEntry[TAPI_SIM_CPHS_CUSTOMER_SERVICE_PROFILE_ENTRY_COUNT_MAX]; /**< service profile entry*/
-} TelSimCphsCustomerServiceProfileInfo_t;
-
-/**
- *
- * This struct gives dynamics flag selected line information.
- */
-typedef struct {
- TelSimDynamicFlagsSelectedLineId_t DynamicFlags; /**< Dynamic flags information */
-} TelSimDynamicFlagsInfo_t;
-
-/**
- *
- * This struct gives dynamics flag selected line information.
- */
-typedef struct {
- TelSimDynamic2FlagAlsStatus_t Dynamic2Flag; /**< Dynamic flags status */
-} TelSimDynamic2FlagsInfo_t;
-
-
-/**
- * This data structure gives the phone book availability of current SIM.
- */
-typedef struct {
- int b_fdn; /**< Fixed Dialing Number */
- int b_adn; /**< SIM - ADN(2G phonebook, Under DF phonebook */
- int b_sdn; /**< Service Dialing Number */
- int b_3g; /**< USIM - 3G phonebook */
- int b_aas; /**< Additional number Alpha String phonebook */
- int b_gas; /**< Grouping information Alpha String phonebook */
-} TelSimPbList_t;
-
-/**
- * This data structure gives the phone book status of current SIM.
- */
-typedef struct {
- int init_completed;
- TelSimPbList_t pb_list;
-} TelSimPbStatus_t;
-
-typedef struct {
- TelSimPbType_t phonebook_type;
- unsigned short index;
- unsigned short next_index; //this field is not used in add/update case
-
- unsigned char name[TAPI_SIM_PB_RECORD_NAME_MAX_LEN+1];
- TelSimTextEncrypt_t dcs;
-
- unsigned char number[TAPI_SIM_PB_RECORD_NUMBER_MAX_LEN+1];
- TelSimTypeOfNum_t ton;
-
- /* following field is valid in only USIM*/
- unsigned char sne[TAPI_SIM_PB_RECORD_NAME_MAX_LEN+1];
- TelSimTextEncrypt_t sne_dcs;
- unsigned char anr1[TAPI_SIM_PB_RECORD_NUMBER_MAX_LEN+1];
- TelSimTypeOfNum_t anr1_ton;
- unsigned char anr2[TAPI_SIM_PB_RECORD_NUMBER_MAX_LEN+1];
- TelSimTypeOfNum_t anr2_ton;
- unsigned char anr3[TAPI_SIM_PB_RECORD_NUMBER_MAX_LEN+1];
- TelSimTypeOfNum_t anr3_ton;
-
- unsigned char email1[TAPI_SIM_PB_RECORD_EMAIL_MAX_LEN+1];
- unsigned char email2[TAPI_SIM_PB_RECORD_EMAIL_MAX_LEN+1];
- unsigned char email3[TAPI_SIM_PB_RECORD_EMAIL_MAX_LEN+1];
- unsigned char email4[TAPI_SIM_PB_RECORD_EMAIL_MAX_LEN+1];
-
- unsigned short group_index; //GRP
- unsigned short pb_control; //PBC
-} TelSimPbRecord_t;
-
-/**
- * This data structure defines the phone book storage count information.
- */
-typedef struct {
- TelSimPbType_t StorageFileType; /**< Storage file type */
- unsigned short TotalRecordCount; /**< Total record count */
- unsigned short UsedRecordCount; /**< Used record count */
-} TelSimPbStorageInfo_t;
-
-/**
- * This data structure gives the phone book entry information.
- */
-typedef struct {
- TelSimPbType_t StorageFileType; /**< Storage file type */
- unsigned short PbIndexMin; /**< Phone book minimum index*/
- unsigned short PbIndexMax; /**< Phone book maximum index */
- unsigned short PbNumLenMax; /**< Phone number maximum length */
- unsigned short PbTextLenMax; /**< Text maximum length */
- unsigned short PbUsedCount; /**< Phone book used record count */
-} TelSimPbEntryInfo_t;
-
-/**
- *
- This structure gives 3G phone book capability information.
- */
-typedef struct {
- TelSimPb3GFileType_t field_type; /**< 3G phonebook file type */
- unsigned short index_max; /**< max index */
- unsigned short text_max; /**< max text length */
- unsigned short used_count; /**< used record count */
-} TelSimPb3GFileTypeCapabiltyInfo_t;
-
-/**
- *
- * This data structure defines the data for the SIM PHONEBOOK & ITS CAPABILITIES information.
- * It refers to EF_PBR
- */
-typedef struct {
- unsigned short FileTypeCount; /**< phonebook file type count */
- TelSimPb3GFileTypeCapabiltyInfo_t FileTypeInfo[TAPI_SIM_PB_3G_FILE_MAX_COUNT]; /**< phonebook file type information */
-} TelSimPbCapabilityInfo_t;
-
-
-
-/* SAP (SIM Access Profile) related interface structures and enum */
-/**
- * This struct gives the SAP ATR response data information.
- */
-typedef struct {
- int atr_len; /**< SAP ATR response data length */
- unsigned char atr_data[TAPI_SIM_SAP_ATR_DATA]; /**< SAP ATR response data */
-} TelSapAtrInfo_t;
-
-/* SAP transfer APDU request */
-
-/**
- * This data structure gives the SAP APDU data information.
- */
-typedef struct {
- int apdu_len; /**< SAP APDU length */
- unsigned char apdu_data[TAPI_SIM_APDU_MAX_LEN]; /**< SAP APDU data */
-} TelSapApduData_t;
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // _TELSIM_H_
-/**
- * @}
- */
+++ /dev/null
-/*
- * tel-plugin-dbus_tapi
- *
- * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * @open
- * @ingroup TelephonyAPI
- * @addtogroup SS_TAPI SS(Supplementary services)
- * @{
- *
- * @file TelSs.h
-
- @brief This file serves as a "C" header file and defines structures for Tapi Supplementary Services\n
- It contains a sample set of constants, enums, structs that would be required by applications.
- */
-
-#ifndef _TEL_SS_H_
-#define _TEL_SS_H_
-
-#include <TelDefines.h>
-#include <TelErr.h>
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/** maximum length of barring password */
-#define TAPI_SS_GSM_BARR_PW_LEN_MAX 4 /**<Maximum length of barring password */
-
-/** maximum length of dial digit */
-#define TAPI_CALL_DIALDIGIT_LEN_MAX 82 /**<maximum length of dial digit *///( To Accommodate Unpacked string length, which will be greater than 182, 182* 8 /7 = 208, Packed len = 182* 7/8 = 160)
-#define TAPI_SS_USSD_DATA_SIZE_MAX 208 /**<User-to-user data maximum size */
-#define TAPI_SS_RECORD_NUM_MAX 5 /**< SS record maximum size */
-#define TAPI_SS_AOC_CURRENCY_LEN_MAX 3 /**< maximum length of AOC currency */
-
-/* Supplementary Svc */
-#define TAPI_SS_ADDRESS_LEN_MAX 40
-#define TAPI_SS_CCBS_SIZE_MAX 5
-#define TAPI_SS_TELECOMM_SERVCE_SIZE_MAX 13
-#define TAPI_SS_PHONE_NUM_LEN_MAX 33
-#define TAPI_SS_MMISTRING_LEN_MAX 33
-#define TAPI_SS_PWD_LEN_MAX 5
-#define TAPI_MAX_RELEASE_COMPLETE_DATA_LEN 260
-#define TAPI_MAX_ULONG 0xffffffff
-
-/**
- * This enumeration defines the call forwarding flavor.
- */
-typedef enum {
- TAPI_SS_CF_WHEN_CFU = 0x01, /* 0x01 : Call Forwarding Unconditional */
- TAPI_SS_CF_WHEN_CFB, /* 0x02 : Call Forwarding Mobile Busy */
- TAPI_SS_CF_WHEN_CFNRy, /* 0x03 : Call Forwarding No Reply */
- TAPI_SS_CF_WHEN_CFNRc, /* 0x04 : Call Forwarding Not Reachable */
- TAPI_SS_CF_WHEN_CF_ALL, /* 0x05 : All Call Forwarding */
- TAPI_SS_CF_WHEN_CFC, /* 0x06 : All Conditional Call Forwarding */
- TAPI_SS_CF_WHEN_MAX /* 0x07 : Max */
-} TelSsForwardWhen_t;
-
-/**
- * The various types of call barring. Note, only one type of incoming barring and only one type of outgoing barring may be active at any time.
- */
-typedef enum {
- TAPI_SS_CB_TYPE_BAOC = 0x01, /* 0x01 : Barring All Outgoing Calls */
- TAPI_SS_CB_TYPE_BOIC, /* 0x02 : Barring Outgoing International Calls */
- TAPI_SS_CB_TYPE_BOIC_NOT_HC, /* 0x03 : Barring Outgoing International Calls
- except to Home Country */
- TAPI_SS_CB_TYPE_BAIC, /* 0x04 : Barring All Incoming Calls */
- TAPI_SS_CB_TYPE_BIC_ROAM, /* 0x05 : Barring Incoming Calls when roam,
- outside of the Home Country */
- TAPI_SS_CB_TYPE_AB, /* 0x06 : All Barring Services */
- TAPI_SS_CB_TYPE_AOB, /* 0x07 : All Outgoing Barring Services */
- TAPI_SS_CB_TYPE_AIB, /* 0x08 : All Incoming Barring Services */
- TAPI_SS_CB_TYPE_BIC_NOT_SIM, /* 0x09 : Barring Incoming Calls which is
- not stored in the SIM memory */
- TAPI_SS_CB_TYPE_MAX
-} TelSsBarringType_t;
-
-/**
- * This enumeration defines the ussd Indication Type
- */
-typedef enum {
- TAPI_SS_USSD_STATUS_NOTIFY = 0x00, /**< notify : to display USSD data to user */
- TAPI_SS_USSD_STATUS_NO_ACTION_REQUIRE = 0x01, /**< No further user action required */
- TAPI_SS_USSD_STATUS_ACTION_REQUIRE = 0x02, /**< Further user action required*/
- TAPI_SS_USSD_STATUS_TERMINATED_BY_NET = 0x03, /**< 0x03 : USSD terminated by network */
- TAPI_SS_USSD_STATUS_OTHER_CLIENT = 0x04, /**< 0x04 : other local client has responded */
- TAPI_SS_USSD_STATUS_NOT_SUPPORT = 0x05, /**< 0x05 : operation not supported */
- TAPI_SS_USSD_STATUS_TIME_OUT = 0x06 /**< 0x06 : Time out when there is no response from network */
-} TelSsUssdStatus_t;
-
-/**
- *
- * This enum defines the values for USSD type.
- */
-typedef enum {
- TAPI_SS_USSD_TYPE_USER_INIT = 0x01, /**< USSD request type User Initiated. */
- TAPI_SS_USSD_TYPE_USER_RSP, /**< USSD request type User Response. */
- TAPI_SS_USSD_TYPE_USER_REL /**< USSD request type User Release. */
-} TelSsUssdType_t;
-
-/**
- * This enumeration defines the call barring operation mode .
- */
-typedef enum {
- TAPI_SS_CB_MODE_ACTIVATE, /**< Activate call barring */
- TAPI_SS_CB_MODE_DEACTIVATE, /**< De Activate call barring */
-} TelSsBarringMode_t;
-
-/**
- * This enumeration defines the call barring operation mode .
- */
-typedef enum {
- TAPI_SS_CW_MODE_ACTIVATE, /**< Activate call barring */
- TAPI_SS_CW_MODE_DEACTIVATE, /**< De Activate call barring */
-} TelSsCallWaitingMode_t;
-
-/**
- * This enumeration defines the call type .
- */
-typedef enum {
- /* TELESERVICE */
- TAPI_SS_CLASS_ALL_TELE=0x10, /* 0x10 : All Teleservices */
- TAPI_SS_CLASS_VOICE=0x11, /* 0x11 : All Voice ( telephony ) */
- TAPI_SS_CLASS_ALL_DATA_TELE=0x12, /* 0x12 : All Data Teleservices */
- TAPI_SS_CLASS_FAX=0x13, /* 0x13 : All Fax Service */
- TAPI_SS_CLASS_SMS=0x16, /* 0x16 : SMS service */
- TAPI_SS_CLASS_VGCS=0x17, /* 0x17 : Voice Group Call Service */
- TAPI_SS_CLASS_VBS=0x18, /* 0x18 : Voice Broadcast */
- TAPI_SS_CLASS_ALL_TELE_EXPT_SMS=0x19, /* 0x19 : All teleservice except SMS */
-
- /* BEARER SERVICE */
- TAPI_SS_CLASS_ALL_BEARER=0x20, /* 0X20 : all bearer services */
- TAPI_SS_CLASS_ALL_ASYNC=0x21, /* 0x21 : All Async services */
- TAPI_SS_CLASS_ALL_SYNC=0x22, /* 0x22 : All sync services*/
- TAPI_SS_CLASS_ALL_CS_SYNC=0x24, /* 0x24 : All Circuit switched sync */
- TAPI_SS_CLASS_ALL_CS_ASYNC=0x25, /* 0x25 : All Circuit switched async */
- TAPI_SS_CLASS_ALL_DEDI_PS=0x26, /* 0x26 : All Dedicated packet Access */
- TAPI_SS_CLASS_ALL_DEDI_PAD=0x27, /* 0x27 : All Dedicated PAD Access */
- TAPI_SS_CLASS_ALL_DATA_CDA=0x28, /*0x28 : All Data CDA*/
-
- /* PLMN SPECIFIC TELESERVICE */
- TAPI_SS_CLASS_PLMN_TELE_ALL = 0x50, /*0x50 : PLMN specific teleservices*/
- TAPI_SS_CLASS_PLMN_TELE_1 = 0x51, /*0x51 :PLMN specific teleservice 1*/
- TAPI_SS_CLASS_PLMN_TELE_2 = 0x52, /*0x52 : PLMN specific teleservice 2*/
- TAPI_SS_CLASS_PLMN_TELE_3 = 0x53, /*0x53 : PLMN specific teleservice 3*/
- TAPI_SS_CLASS_PLMN_TELE_4 = 0x54, /*0x54 : PLMN specific teleservice 4*/
- TAPI_SS_CLASS_PLMN_TELE_5 = 0x55, /*0x55 : PLMN specific teleservice 5*/
- TAPI_SS_CLASS_PLMN_TELE_6 = 0x56, /*0x56 : PLMN specific teleservice 6*/
- TAPI_SS_CLASS_PLMN_TELE_7 = 0x57, /*0x57 : PLMN specific teleservice 7*/
- TAPI_SS_CLASS_PLMN_TELE_8 = 0x58, /*0x58 : PLMN specific teleservice 8*/
- TAPI_SS_CLASS_PLMN_TELE_9 = 0x59, /*0x59 : PLMN specific teleservice 9*/
- TAPI_SS_CLASS_PLMN_TELE_A = 0x60, /*0x60 :PLMN specific teleservice 10*/
- TAPI_SS_CLASS_PLMN_TELE_B = 0x61, /*0x61 :PLMN specific teleservice 11*/
- TAPI_SS_CLASS_PLMN_TELE_C = 0x62, /*0x62 : PLMN specific teleservice 12*/
- TAPI_SS_CLASS_PLMN_TELE_D = 0x63, /*0x63 : PLMN specific teleservice 13*/
- TAPI_SS_CLASS_PLMN_TELE_E = 0x64, /*0x64 : PLMN specific teleservice 14*/
- TAPI_SS_CLASS_PLMN_TELE_F = 0x65, /*0x65 : PLMN specific teleservice 15*/
-
- /* PLMN SPECIFIC BEARER SERVICE */
- TAPI_SS_CLASS_PLMN_BEAR_ALL = 0x70, /*0x70 : All PLMN specific bearer services*/
- TAPI_SS_CLASS_PLMN_BEAR_1 = 0x71, /*0x71 :PLMN specific bearer service 1*/
- TAPI_SS_CLASS_PLMN_BEAR_2 = 0x72, /*0x72 : PLMN specific bearer service 2*/
- TAPI_SS_CLASS_PLMN_BEAR_3 = 0x73, /*0x73 : PLMN specific bearer service 3*/
- TAPI_SS_CLASS_PLMN_BEAR_4 = 0x74, /*0x74 : PLMN specific bearer service 4*/
- TAPI_SS_CLASS_PLMN_BEAR_5 = 0x75, /*0x75 : PLMN specific bearer service 5*/
- TAPI_SS_CLASS_PLMN_BEAR_6 = 0x76, /*0x76 : PLMN specific bearer service 6*/
- TAPI_SS_CLASS_PLMN_BEAR_7 = 0x77, /*0x77 : PLMN specific bearer service 7*/
- TAPI_SS_CLASS_PLMN_BEAR_8 = 0x78, /*0x78 : PLMN specific bearer service 8*/
- TAPI_SS_CLASS_PLMN_BEAR_9 = 0x79, /*0x79 : PLMN specific bearer service 9*/
- TAPI_SS_CLASS_PLMN_BEAR_A = 0x80, /*0x80 : PLMN specific bearer service 10*/
- TAPI_SS_CLASS_PLMN_BEAR_B = 0x81, /*0x81 : PLMN specific bearer service 11*/
- TAPI_SS_CLASS_PLMN_BEAR_C = 0x82, /*0x82 : PLMN specific bearer service 12*/
- TAPI_SS_CLASS_PLMN_BEAR_D = 0x83, /*0x83 : PLMN specific bearer service 13*/
- TAPI_SS_CLASS_PLMN_BEAR_E = 0x84, /*0x84 : PLMN specific bearer service 14*/
- TAPI_SS_CLASS_PLMN_BEAR_F = 0x85, /*0x85 : PLMN specific bearer service 15*/
-
- /* CPHS - AUXILIARY SERVICE */
- TAPI_SS_CLASS_AUX_VOICE = 0x89, /* 0x89 : All Auxiliary Voice ( Auxiliary telephony ) */
-
- TAPI_SS_CLASS_ALL_GPRS_BEARER=0x99, /* 0x99 : All GPRS bearer services */
- TAPI_SS_CLASS_ALL_TELE_BEARER=0xFF, /* 0xFF : all tele and bearer services */
-} TelSsClass_t;
-
-/**
- * This enumeration defines the forward mode .
- */
-typedef enum {
- TAPI_SS_CF_MODE_DISABLE_EV, /**< Deactivate call forwarding */
- TAPI_SS_CF_MODE_ENABLE_EV, /**< Activate call forwarding */
- TAPI_SS_CF_MODE_REGISTRATION_EV, /**< Register Call forwarding */
- TAPI_SS_CF_MODE_ERASURE_EV, /**< De-register call forwarding */
-} TelSsForwardMode_t;
-
-typedef enum {
- TAPI_SS_CF_NO_REPLY_TIME_5_SECS = 5, /**< Timer value set to 5secs*/
- TAPI_SS_CF_NO_REPLY_TIME_10_SECS = 10, /**< Timer value set to 10secs*/
- TAPI_SS_CF_NO_REPLY_TIME_15_SECS = 15, /**< Timer value set to 15secs*/
- TAPI_SS_CF_NO_REPLY_TIME_20_SECS = 20, /**< Timer value set to 20secs*/
- TAPI_SS_CF_NO_REPLY_TIME_25_SECS = 25, /**< Timer value set to 25secs*/
- TAPI_SS_CF_NO_REPLY_TIME_30_SECS = 30, /**< Timer value set to 30secs*/
-} TelSsNoReplyTime_t;
-
-/**
- * Describes whether a supplementary service request was a success or a failure; and if it failed, why.
- */
-typedef enum {
- TAPI_SS_SUCCESS=0x0, /**< SS operation was successful */
-
- TAPI_SS_UNKNOWNSUBSCRIBER= 0x01, /**< SS error indicating unknown/illegal subscriber. */
- TAPI_SS_ILLEGALSUBSCRIBER= 0x09, /**<This error is returned when illegality of the access has been @n
- established by use of authentication procedure. */
-
- TAPI_SS_BEARERSERVICENOTPROVISIONED= 0x0a, /**<The network returns this error when it is requested to @n
- perform an operation on a supplementary service */
- TAPI_SS_TELESERVICENOTPROVISIONED= 0x0b, /**<The network returns this error when it is requested to perform @n
- an operation on a supplementary service */
- TAPI_SS_ILLEGALEQUIPMENT= 0x0c, /**<This error is returned when the IMEI check procedure has shown that @n
- the IMEI is blacklisted or not whitelisted */
- TAPI_SS_CALLBARRED= 0x0d, /**< This error is returned by the network to the MS when call independent subscriber control procedures are barred by the operator */
- TAPI_SS_ILLEGALSSOPERATION=0x10, /**<This error is returned by the network when it is requested to perform an illegal operation @n
- which is defined as not applicable for the relevant supplementary service */
- TAPI_SS_ERRORSTATUS= 0x11, /**<This error is returned by the network when it is requested to perform an operation @n
- which is not compatible with the current status of the relevant supplementary service. */
- TAPI_SS_NOTAVAILABLE= 0x12, /**< SS not available in network */
- TAPI_SS_SUBSCRIPTIONVIOLATION= 0x13, /**< SS service subscription violation. */
- TAPI_SS_INCOMPATIBILITY= 0x14, /**< This error is returned by the network when it is requested for a supplementary service operation incompatible with the @n
- status of another supplementary service or with the teleservice or bearer service for which the operation is requested */
- TAPI_SS_FACILITYNOTSUPPORTED= 0x15, /**< SS service facility not supported */
- TAPI_SS_ABSENTSUBSCRIBER= 0x1b, /**< This error is returned when the subscriber has activated the detach service or the system detects the absence condition */
-
- TAPI_SS_SYSTEMFAILURE= 0x22, /**< This error is returned by the network, when it cannot perform an operation because of a failure in the network */
- TAPI_SS_DATAMISSING= 0x23, /**< This error is returned by the network when an optional parameter is missing in an invoke component @n
- or an inner data structure, while it is required by the context of the request. */
- TAPI_SS_UNEXPECTEDDATAVALUE= 0x24, /**< SS error indicating unexpected data value on network side *//**< SS operation barred. */
- TAPI_SS_PWREGISTRATIONFAILURE= 0x25, /**< SS error indicating change password failure. */
- TAPI_SS_NEGATIVEPWCHECK= 0x26, /**< SS error indicating negative password check. */
- TAPI_SS_NUMBEROFPWATTEMPTSVIOLATION= 0x2b, /**< SS error indicating barring password attempts violated. */
-
- TAPI_SS_UNKNOWNALPHABET= 0x47, /**< SS error indicating unknown SS data coding of alphabet */
- TAPI_SS_USSDBUSY= 0x48, /**< SS error indicating USSD Busy(Already SS / USSD is ongoing). */
-
- TAPI_SS_REJECTEDBYUSER= 0x79, /**< SS operation rejected by user. */
- TAPI_SS_REJECTEDBYNETWORK=0x7a, /**< SS operation rejected by network. */
- TAPI_SS_DEFLECTIONTOSERVEDSUBSCRIBER= 0x7b, /**< This error is returned if a diversion to the served @n
- subscriber's number was requested. */
- TAPI_SS_SPECIALSERVICECODE= 0x7c, /**< This error is returned if diversion to a special service code was requested. */
- TAPI_SS_INVALIDDEFLECTEDTONUMBER= 0x7d, /**< SS error indicating the invalid deflected to number. */
- TAPI_SS_MAXNOMPTYEXCEEDED= 0x7e, /**< SS error indicating Maximum MPTY is reached. */
- TAPI_SS_RESOURCESNOTAVAILABLE= 0x7f, /**< SS error indicating resources not available in network. */
-
- TAPI_SS_TIMEREXPIRE, /**< SS operation timer expired on network. */
- TAPI_SS_NET_NOT_ALLOWED_EMERGENCY_CALLS_ONLY, /**< SS operation is not allowed by network. */
- TAPI_SS_UNKNOWNERROR, /**< SS error indicating unknown error */
- TAPI_SS_OEM_NOT_SUPPORTED /**< If oem do not support any of SS requests, then this error will be returned back */
-} TelSsCause_t;
-
-/**
- * The status of a supplementary service feature (e.g. Call Forwarding or Call Barring). @n
- * These enumerated values should be used as masks
- */
-typedef enum {
- TAPI_SS_STATUS_REGISTERED = 0x01, /**< Provisioned & registered (but not active/active-quiescent */
- TAPI_SS_STATUS_PROVISIONED, /**<Provisioned but not registered (or active/active-quiescent) */
- TAPI_SS_STATUS_ACTIVE, /**< Provisioned & registered & active */
- TAPI_SS_STATUS_QUIESCENT, /**< Provisioned & registered & active but quiescent */
- TAPI_SS_STATUS_NOTHING /**< Not provisioned */
-} TelSsStatus_t;
-
-/**
- * These are the four types of identity presentation / restriction services.
- */
-typedef enum {
- TAPI_CALLING_LINE_IDENTITY_PRESENTATION= 0x01, /**< identify the party calling this phone */
- TAPI_CALLING_LINE_IDENTITY_RESTRICTION, /**< hide the identity of this phone when calling others */
- TAPI_CONNECTED_LINE_IDENTITY_PRESENTATION, /**< identify the party to whom the calling party (this phone) is connected */
- TAPI_CONNECTED_LINE_IDENTITY_RESTRICTION, /**< restrict yourself from being identified by incoming calls, such as forwarded calls */
- TAPI_CALLED_LINE_IDENTITY_PRESENTATION, /**< Called line identity presentation */
- TAPI_CALLING_NAME_PRESENTATION /**< Calling Name Presentation */
-} TelSsLineIdentificationType_t;
-
-/**
- * This enumeration defines the cli service status .
- */
-typedef enum {
- TAPI_CLI_STATUS_NOT_PROVISONED = 0x01, /**<Service not provided by the service provider */
- TAPI_CLI_STATUS_PROVISIONED, /**<Service is provided by the service provider */
- TAPI_CLI_STATUS_ACTIVATED, /**<Service is activated at the network */
- TAPI_CLI_STATUS_UNKOWN, /**<Service status is unknown*/
- TAPI_CLI_STATUS_TEMP_RESTRICTED, /**<Service is temporarily restricted */
- TAPI_CLI_STATUS_TEMP_ALLOWED /**<Service is temporarily allowed */
-} TelSsCliStatus_t;
-
-/**
- * This enumeration defines the values for Cli service type .
- */
-typedef enum {
- TAPI_SS_CLI_CLIP = 0x01, /**< Calling Line Identification Presentation. */
- TAPI_SS_CLI_CLIR = 0x02, /**< Calling Line Identification Restriction. */
- TAPI_SS_CLI_COLP = 0x03, /**< Connected Line Identification Presentation. */
- TAPI_SS_CLI_COLR = 0x04, /**< Connected Line Identification Restriction. */
- TAPI_SS_CLI_CDIP = 0x05, /**< Called Line Identification Presentation. */
- TAPI_SS_CLI_CNAP = 0x06, /**< Calling Name Presentation.*/
-} TelSsCliType_t;
-
-/**
- * This enum defines the values for AOC type.
- */
-typedef enum {
- TAPI_SS_AOC_TYPE_RESET = 0x00, /**< Specifies the Reset MAXACM Value. */
- TAPI_SS_AOC_TYPE_ACM = 0x01, /**< Specifies the Accumulated call meter. */
- TAPI_SS_AOC_TYPE_CCM = 0x02, /**< Specifies the Current call meter. */
- TAPI_SS_AOC_TYPE_MAXACM = 0x04, /**< Specifies the Max accumulated call meter. */
- TAPI_SS_AOC_TYPE_PUC = 0x08 /**< Specifies the Price per unit and currency.*/
-} TelSsAocType_t;
-
-typedef enum {
- TAPI_SS_TYPE_BARRING = 0x00,
- TAPI_SS_TYPE_FORWARDING,
- TAPI_SS_TYPE_WAITING,
- TAPI_SS_TYPE_CLI,
- TAPI_SS_TYPE_SEND_USSD,
- TAPI_SS_TYPE_MAX
-}TelSsInfoType_t;
-
-/**
- * This structure defines the different parameters related to forward info.
- */
-typedef struct {
- TelSsClass_t Class;
- TelSsForwardMode_t Mode; /**< Forward Mode */
- TelSsForwardWhen_t Condition; /**< Forward Condition */
- char szPhoneNumber[TAPI_CALL_DIALDIGIT_LEN_MAX]; /**< Phone Number*/
- TelSsNoReplyTime_t NoReplyConditionTimer; /**< No reply wait time 5-30 secs in intervals of 5. */
-} TelSsForwardInfo_t;
-
-/**
- * This structure defines the values for USSD request type.
- */
-typedef struct {
- TelSsUssdType_t Type;
- int Length; /**< USSD String Length */
- char szString[TAPI_SS_USSD_DATA_SIZE_MAX]; /**< USSD String */
-} TelSsUssdMsgInfo_t;
-
-/**
- * This structure defines the different parameters related to call barring.
- */
-typedef struct {
- TelSsClass_t Class; /**< Call type */
- TelSsBarringMode_t Mode; /**< Barring mode */
- TelSsBarringType_t Type; /**< Barring type */
- char szPassword[TAPI_SS_GSM_BARR_PW_LEN_MAX]; /**< password */
-} TelSsBarringInfo_t;
-
-/**
- * This structure defines the different parameters related to call waiting.
- */
-typedef struct {
- TelSsClass_t Class; /**< Call type */
- TelSsCallWaitingMode_t Mode; /**< Waiting mode */
-} TelSsWaitingInfo_t;
-
-/**
- * This structure defines the SUPS information message notification type.
- */
-typedef struct {
- TelSsCause_t Cause; /**< Cause */
- TelSsInfoType_t SsType; /**< SUPS Information */
-} TelSsInfo_t;
-
-/**
- * This structure defines the release complete message notification type.
- */
-typedef struct {
- unsigned char RelCompMsgLen; /**< Specifies the Release complete msg length.*/
- unsigned char szRelCompMsg[TAPI_MAX_RELEASE_COMPLETE_DATA_LEN]; /**< Specifies the Release complete msg. */
-} TelSsRelCompMsgInfo_t;
-
-/**
- * This structure defines the values for AOC request type.
- */
-
-typedef struct {
- float PPM;
- unsigned char CharTypeOfCurrency;
- unsigned char szCurrency[TAPI_SS_AOC_CURRENCY_LEN_MAX];
-} TelAocPucInfo_t;
-
-typedef struct {
- TelSsAocType_t AocType; /**< Specifies the AOC type. */
- unsigned int ACM; /**< Specifies the accumulated call meter value. */
- unsigned int MaxAcm; /**< Specifies the maximum value of ACM . */
- float CCM; /**< Specifies the Current call meter value. */
- float PPM; /**< Specifies the Price per unit value. */
- unsigned char CharTypeOfCurrency; /**< Specifies the Char type of currency. */
- unsigned char szCurrency[TAPI_SS_AOC_CURRENCY_LEN_MAX]; /**< Specifies the Currency characters. */
-} TelCallAocInfo_t;
-
-/**
- * This structure defines the values for ss call barring record
- */
-typedef struct {
- int record_num;
- struct {
- TelSsClass_t Class;
- TelSsStatus_t Status; /**< SS status */
- TelSsBarringType_t Flavour; /**< Call barring types providing various barring conditions on that basis call be barred */
- } record[TAPI_SS_RECORD_NUM_MAX]; /**< Specifies the Maximum of TAPI_SS_RECORD_NUM_MAX records. */
-} TelSsBarringResp_t;
-
-/**
- * This structure defines the values for ss call forwarding record
- */
-typedef struct {
- int record_num;
- struct {
- TelSsClass_t Class;
- TelSsStatus_t Status; /**< Call forwarding SS status */
- TelSsForwardWhen_t ForwardCondition; /**< Call forward types providing various conditions when call can be forwarded */
- int bCallForwardingNumberPresent; /**< Call forwarding number present or not */
- unsigned char NoReplyWaitTime;
- unsigned char szCallForwardingNumber[TAPI_CALL_DIALDIGIT_LEN_MAX + 1]; /**< forwarded number.[Null Terminated string]*/
- } record[TAPI_SS_RECORD_NUM_MAX]; /**< Specifies the Maximum of TAPI_SS_RECORD_NUM_MAX records. */
-} TelSsForwardResp_t;
-
-/**
- * This structure defines the values for ss call waiting record
- */
-typedef struct {
- int record_num;
- struct {
- TelSsClass_t Class;
- TelSsStatus_t Status; /**< SS status */
- } record[TAPI_SS_RECORD_NUM_MAX]; /**< Specifies the Maximum of TAPI_SS_RECORD_NUM_MAX records. */
-} TelSsWaitingResp_t;
-
-/**
- * This structure defines the values for Calling line identity service
- */
-typedef struct {
- TelSsLineIdentificationType_t Type; /**< Various line identification types */
- TelSsCliStatus_t Status; /**< Line identification status from network */
-} TelSsCliResp_t;
-
-typedef struct {
- TelSsUssdType_t Type;
- TelSsUssdStatus_t Status;
- int Length; /**< USSD String Length */
- char szString[TAPI_SS_USSD_DATA_SIZE_MAX]; /**< USSD String */
-} TelSsUssdResp_t;
-
-typedef struct {
- TelSsUssdStatus_t Status;
- int Length; /**< USSD String Length */
- char szString[TAPI_SS_USSD_DATA_SIZE_MAX]; /**< USSD String */
-} TelSsUssdNoti_t;
-
-typedef struct {
- float PPM; /**< Specifies the Price per unit value. */
- unsigned char CharTypeOfCurrency; /**< Specifies the Char type of currency. */
- unsigned char szCurrency[TAPI_SS_AOC_CURRENCY_LEN_MAX]; /**< Specifies the Currency characters. */
-} TelSsAoc_ppm_info_t;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // _TEL_SS_H_
-/**
- * @}
- */
+/*
+ * tel-plugin-dbus-tapi
+ *
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Ja-young Gu <jygu@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <aul.h>
#include <appsvc.h>
-#include <bundle.h>
+#include <bundle_internal.h>
-#include "TelSat.h"
#include "sat_ui_support.h"
-#include "package-manager.h"
+
+#define CISS_APP "org.tizen.ciss"
+#define EVENT_DOWNLOADER_SLOT1 "org.tizen.sat-event-downloader"
+#define EVENT_DOWNLOADER_SLOT2 "org.tizen.sat-event-downloader-2"
struct sat_ui_app_launch_data {
bundle *bundle_data; /**<bundle data*/
int i = 0;
struct sat_ui_app_launch_data *app_data = (struct sat_ui_app_launch_data *)data;
- if(!app_data) {
+ if (!app_data) {
err("app_data does not exist");
goto EXIT;
}
- if(!app_data->bundle_data) {
+ if (!app_data->bundle_data) {
err("bundle_data not present");
goto EXIT;
}
- if(!app_data->slot_info) {
+ if (!app_data->slot_info) {
err("slot_info not present");
goto EXIT;
}
- for (i=0; i<RETRY_MAXCOUNT; i++)
- {
- if(g_str_has_suffix(app_data->slot_info , "0")){
+ for (i = 0; i < RETRY_MAXCOUNT; i++) {
+ if (g_str_has_suffix(app_data->slot_info , "0")) {
dbg("slot 0");
rv = aul_launch_app("org.tizen.sat-ui", app_data->bundle_data);
- } else if (g_str_has_suffix(app_data->slot_info , "1")){
+ } else if (g_str_has_suffix(app_data->slot_info , "1")) {
dbg("slot 1");
rv = aul_launch_app("org.tizen.sat-ui-2", app_data->bundle_data);
} else {
return FALSE;
}
thread = g_thread_new(name, thread_cb, thread_data);
- if (thread == NULL){
+ if (thread == NULL) {
return FALSE;
- }else{
+ } else {
dbg("Thread %p is created for %s", thread, name);
+ g_thread_unref(thread);
}
return TRUE;
{
struct sat_ui_app_launch_data *app_data = NULL;
- app_data= g_malloc0(sizeof(struct sat_ui_app_launch_data));
+ app_data = g_malloc0(sizeof(struct sat_ui_app_launch_data));
if (!app_data) {
err("malloc failed");
return FALSE;
gboolean rv = FALSE;
bundle *bundle_data = 0;
gchar *encoded_data = NULL, *cmd_type = NULL;
- TelSatSetupMenuInfo_t setup_menu;
+ struct tel_sat_setup_menu_info setup_menu;
gchar *title = NULL;
gint command_id, item_cnt;
gchar *item_str;
gint item_id;
#endif
- memset(&setup_menu, 0, sizeof(TelSatSetupMenuInfo_t));
+ memset(&setup_menu, 0, sizeof(struct tel_sat_setup_menu_info));
#if defined(TIZEN_SUPPORT_SAT_ICON)
g_variant_get(data, "(ibs@vibb@v@v)", &command_id, &b_present, &title, &items, &item_cnt,
#endif
setup_menu.commandId = command_id;
setup_menu.bIsMainMenuPresent = (b_present ? 1 : 0);
- memcpy(setup_menu.satMainTitle, title, TAPI_SAT_DEF_TITLE_LEN_MAX+1);
+ memcpy(setup_menu.satMainTitle, title, SAT_ALPHA_ID_LEN_MAX+1);
g_free(title);
setup_menu.satMainMenuNum = item_cnt;
- if(items && item_cnt > 0){
+ if (items && item_cnt > 0) {
unbox = g_variant_get_variant(items);
dbg("items(%p) items type_format(%s)", items, g_variant_get_type_string(unbox));
g_variant_get(unbox, "a(si)", &iter);
- while(g_variant_iter_loop(iter,"(si)",&item_str, &item_id)){
+ while (g_variant_iter_loop(iter, "(si)", &item_str, &item_id)) {
setup_menu.satMainMenuItem[local_index].itemId = item_id;
- memcpy(setup_menu.satMainMenuItem[local_index].itemString, item_str, TAPI_SAT_DEF_ITEM_STR_LEN_MAX + 6);
+ memcpy(setup_menu.satMainMenuItem[local_index].itemString, item_str, SAT_DEF_ITEM_STR_LEN_MAX + 6);
local_index++;
}
g_variant_iter_free(iter);
setup_menu.bIsUpdatedSatMainMenu = (b_updated ? 1 : 0);
#if defined(TIZEN_SUPPORT_SAT_ICON)
- if(icon_id) {
+ if (icon_id) {
unbox = g_variant_get_variant(icon_id);
g_variant_get(unbox, "a(biiiiiis)", &iter);
- while(g_variant_iter_loop(iter,"(biiiiiis)", &is_exist, &icon_quali, &icon_identifier, &width, &height, &ics, &icon_data_len, &icon_data)){
- if(!is_exist)
+ while (g_variant_iter_loop(iter, "(biiiiiis)", &is_exist, &icon_quali, &icon_identifier, &width, &height, &ics, &icon_data_len, &icon_data)) {
+ if (!is_exist)
break;
setup_menu.iconId.bIsPresent = is_exist;
setup_menu.iconId.iconQualifier = icon_quali;
setup_menu.iconId.iconInfo.width = width;
setup_menu.iconId.iconInfo.height = height;
setup_menu.iconId.iconInfo.ics = ics;
- if(icon_data_len > 0) {
+ if (icon_data_len > 0) {
setup_menu.iconId.iconInfo.iconDataLen = icon_data_len;
memcpy(setup_menu.iconId.iconInfo.iconFile, icon_data, icon_data_len);
}
g_variant_iter_free(iter);
}
- if(icon_list){
+ if (icon_list) {
unbox_list = g_variant_get_variant(icon_list);
g_variant_get(unbox_list, "a(biiv)", &iter);
- while(g_variant_iter_loop(iter,"(biiv)", &is_list_exist, &icon_list_quali, &list_cnt, &icon_list_info)){
- if(!is_list_exist)
+ while (g_variant_iter_loop(iter, "(biiv)", &is_list_exist, &icon_list_quali, &list_cnt, &icon_list_info)) {
+ if (!is_list_exist)
break;
setup_menu.iconIdList.bIsPresent = is_list_exist;
setup_menu.iconIdList.iconListQualifier = icon_list_quali;
unbox_list_info = g_variant_get_variant(icon_list_info);
g_variant_get(unbox_list_info, "a(iiiiis)", &iter2);
- while(g_variant_iter_loop(iter2,"(iiiiis)",&icon_list_identifier, &list_width, &list_height, &list_ics, &icon_list_data_len, &icon_list_data)){
- setup_menu.iconIdList.iconIdentifierList[icon_index]= icon_identifier;
+ while (g_variant_iter_loop(iter2, "(iiiiis)", &icon_list_identifier, &list_width, &list_height, &list_ics, &icon_list_data_len, &icon_list_data)) {
+ setup_menu.iconIdList.iconIdentifierList[icon_index] = icon_identifier;
setup_menu.iconIdList.iconInfo[icon_index].width = list_width;
setup_menu.iconIdList.iconInfo[icon_index].height = list_height;
setup_menu.iconIdList.iconInfo[icon_index].ics = list_ics;
- if(icon_list_data_len > 0) {
+ if (icon_list_data_len > 0) {
setup_menu.iconIdList.iconInfo[icon_index].iconDataLen = icon_list_data_len;
memcpy(setup_menu.iconIdList.iconInfo[icon_index].iconFile, icon_list_data, icon_list_data_len);
}
}
#endif
cmd_type = g_strdup_printf("%d", SAT_PROATV_CMD_SETUP_MENU);
- encoded_data = g_base64_encode((const guchar*)&setup_menu, sizeof(TelSatSetupMenuInfo_t));
+ encoded_data = g_base64_encode((const guchar*)&setup_menu, sizeof(struct tel_sat_setup_menu_info));
bundle_data = bundle_create();
bundle_add(bundle_data, "KEY_EXEC_TYPE", "1");
gboolean rv = FALSE;
bundle *bundle_data = 0;
gchar *encoded_data = NULL, *cmd_type = NULL;
- TelSatDisplayTextInd_t display_text;
+ struct tel_sat_display_text_ind display_text;
gchar* text = NULL;
gint command_id, text_len, duration;
gchar *icon_data = NULL;
GVariantIter *iter;
#endif
- memset(&display_text, 0, sizeof(TelSatDisplayTextInd_t));
+ memset(&display_text, 0, sizeof(struct tel_sat_display_text_ind));
#if defined(TIZEN_SUPPORT_SAT_ICON)
g_variant_get(data, "(isiibbb@v)", &command_id, &text, &text_len, &duration,
&high_priority, &user_rsp_required, &immediately_rsp);
#endif
display_text.commandId = command_id;
- memcpy(display_text.text.string, text, TAPI_SAT_DEF_TEXT_STRING_LEN_MAX+1);
+ memcpy(display_text.text.string, text, SAT_TEXT_STRING_LEN_MAX+1);
g_free(text);
display_text.text.stringLen = text_len;
display_text.b_immediately_resp = (immediately_rsp ? 1 : 0);
#if defined(TIZEN_SUPPORT_SAT_ICON)
- if(icon_id) {
+ if (icon_id) {
unbox = g_variant_get_variant(icon_id);
g_variant_get(unbox, "a(biiiiiis)", &iter);
- while(g_variant_iter_loop(iter,"(biiiiiis)", &is_exist, &icon_quali, &icon_identifier, &width, &height, &ics, &icon_data_len, &icon_data)) {
- if(!is_exist)
+ while (g_variant_iter_loop(iter, "(biiiiiis)", &is_exist, &icon_quali, &icon_identifier, &width, &height, &ics, &icon_data_len, &icon_data)) {
+ if (!is_exist)
break;
display_text.iconId.bIsPresent = is_exist;
display_text.iconId.iconQualifier = icon_quali;
display_text.iconId.iconInfo.width = width;
display_text.iconId.iconInfo.height = height;
display_text.iconId.iconInfo.ics = ics;
- if(icon_data_len > 0) {
+ if (icon_data_len > 0) {
display_text.iconId.iconInfo.iconDataLen = icon_data_len;
memcpy(display_text.iconId.iconInfo.iconFile, icon_data, icon_data_len);
}
dbg("duration(%d) user_rsp(%d) immediately_rsp(%d)", duration, user_rsp_required, immediately_rsp);
cmd_type = g_strdup_printf("%d", SAT_PROATV_CMD_DISPLAY_TEXT);
- encoded_data = g_base64_encode((const guchar*)&display_text, sizeof(TelSatDisplayTextInd_t));
+ encoded_data = g_base64_encode((const guchar*)&display_text, sizeof(struct tel_sat_display_text_ind));
bundle_data = bundle_create();
bundle_add(bundle_data, "KEY_EXEC_TYPE", "1");
gboolean rv = FALSE;
bundle *bundle_data = 0;
gchar *encoded_data = NULL, *cmd_type = NULL;
- TelSatSelectItemInd_t select_item;
+ struct tel_sat_select_item_ind select_item;
gboolean help_info ;
gchar *selected_text = NULL;
- gint command_id, default_item_id, menu_cnt, text_len =0;
+ gint command_id, default_item_id, menu_cnt, text_len = 0;
GVariant *menu_items;
#if defined(TIZEN_SUPPORT_SAT_ICON)
GVariant *icon_id, *icon_list;
gchar *item_str;
gint item_id, item_len;
#endif
- memset(&select_item, 0, sizeof(TelSatSelectItemInd_t));
+ memset(&select_item, 0, sizeof(struct tel_sat_select_item_ind));
#if defined(TIZEN_SUPPORT_SAT_ICON)
g_variant_get(data, "(ibsiii@v@v@v)", &command_id, &help_info, &selected_text,
#endif
select_item.commandId = command_id;
select_item.bIsHelpInfoAvailable = (help_info ? 1 : 0);
- memcpy(select_item.text.string, selected_text, TAPI_SAT_DEF_TEXT_STRING_LEN_MAX+1);
+ memcpy(select_item.text.string, selected_text, SAT_TEXT_STRING_LEN_MAX+1);
g_free(selected_text);
select_item.text.stringLen = text_len;
select_item.defaultItemIndex = default_item_id;
select_item.menuItemCount = menu_cnt;
- if(menu_items && menu_cnt > 0){
+ if (menu_items && menu_cnt > 0) {
unbox = g_variant_get_variant(menu_items);
dbg("items(%p) items type_format(%s)", menu_items, g_variant_get_type_string(unbox));
g_variant_get(unbox, "a(iis)", &iter);
- while(g_variant_iter_loop(iter,"(iis)",&item_id, &item_len, &item_str)){
+ while (g_variant_iter_loop(iter, "(iis)", &item_id, &item_len, &item_str)) {
select_item.menuItem[local_index].itemId = item_id;
select_item.menuItem[local_index].textLen = item_len;
- memcpy(select_item.menuItem[local_index].text, item_str, TAPI_SAT_ITEM_TEXT_LEN_MAX + 1);
+ memcpy(select_item.menuItem[local_index].text, item_str, SAT_ITEM_TEXT_LEN_MAX + 1);
local_index++;
}
g_variant_iter_free(iter);
}
#if defined(TIZEN_SUPPORT_SAT_ICON)
- if(icon_id) {
+ if (icon_id) {
unbox = g_variant_get_variant(icon_id);
g_variant_get(unbox, "a(biiiiiis)", &iter);
- while(g_variant_iter_loop(iter,"(biiiiiis)", &is_exist, &icon_quali, &icon_identifier, &width, &height, &ics, &icon_data_len, &icon_data)) {
- if(!is_exist)
+ while (g_variant_iter_loop(iter, "(biiiiiis)", &is_exist, &icon_quali, &icon_identifier, &width, &height, &ics, &icon_data_len, &icon_data)) {
+ if (!is_exist)
break;
select_item.iconId.bIsPresent = is_exist;
select_item.iconId.iconQualifier = icon_quali;
select_item.iconId.iconInfo.width = width;
select_item.iconId.iconInfo.height = height;
select_item.iconId.iconInfo.ics = ics;
- if(icon_data_len > 0) {
+ if (icon_data_len > 0) {
select_item.iconId.iconInfo.iconDataLen = icon_data_len;
memcpy(select_item.iconId.iconInfo.iconFile, icon_data, icon_data_len);
}
g_variant_iter_free(iter);
}
- if(icon_list){
+ if (icon_list) {
unbox_list = g_variant_get_variant(icon_list);
g_variant_get(unbox_list, "a(biiv)", &iter);
- while(g_variant_iter_loop(iter,"(biiv)", &is_list_exist, &icon_list_quali, &list_cnt, &icon_list_info)) {
- if(!is_list_exist)
+ while (g_variant_iter_loop(iter, "(biiv)", &is_list_exist, &icon_list_quali, &list_cnt, &icon_list_info)) {
+ if (!is_list_exist)
break;
select_item.iconIdList.bIsPresent = is_list_exist;
select_item.iconIdList.iconListQualifier = icon_list_quali;
unbox_list_info = g_variant_get_variant(icon_list_info);
g_variant_get(unbox_list_info, "a(iiiiis)", &iter2);
- while(g_variant_iter_loop(iter2,"(iiiiis)",&icon_list_identifier, &list_width, &list_height, &list_ics, &icon_list_data_len, &icon_list_data)){
- select_item.iconIdList.iconIdentifierList[icon_index]= icon_identifier;
+ while (g_variant_iter_loop(iter2, "(iiiiis)", &icon_list_identifier, &list_width, &list_height, &list_ics, &icon_list_data_len, &icon_list_data)) {
+ select_item.iconIdList.iconIdentifierList[icon_index] = icon_identifier;
select_item.iconIdList.iconInfo[icon_index].width = list_width;
select_item.iconIdList.iconInfo[icon_index].height = list_height;
select_item.iconIdList.iconInfo[icon_index].ics = list_ics;
- if(icon_list_data_len > 0) {
+ if (icon_list_data_len > 0) {
select_item.iconIdList.iconInfo[icon_index].iconDataLen = icon_list_data_len;
memcpy(select_item.iconIdList.iconInfo[icon_index].iconFile, icon_list_data, icon_list_data_len);
}
}
#endif
cmd_type = g_strdup_printf("%d", SAT_PROATV_CMD_SELECT_ITEM);
- encoded_data = g_base64_encode((const guchar*)&select_item, sizeof(TelSatSelectItemInd_t));
+ encoded_data = g_base64_encode((const guchar*)&select_item, sizeof(struct tel_sat_select_item_ind));
bundle_data = bundle_create();
bundle_add(bundle_data, "KEY_EXEC_TYPE", "1");
gboolean rv = FALSE;
bundle *bundle_data = 0;
gchar *encoded_data = NULL, *cmd_type = NULL;
- TelSatGetInkeyInd_t get_inkey;
+ struct tel_sat_get_inkey_ind get_inkey;
gint command_id, key_type, input_character_mode;
gint text_len, duration;
gchar *icon_data = NULL;
GVariantIter *iter;
#endif
- memset(&get_inkey, 0, sizeof(TelSatGetInkeyInd_t));
+ memset(&get_inkey, 0, sizeof(struct tel_sat_get_inkey_ind));
#if defined(TIZEN_SUPPORT_SAT_ICON)
g_variant_get(data, "(iiibbsii@v)", &command_id, &key_type, &input_character_mode,
- &b_numeric,&b_help_info, &text, &text_len, &duration, &icon_id);
+ &b_numeric, &b_help_info, &text, &text_len, &duration, &icon_id);
#else
g_variant_get(data, "(iiibbsii)", &command_id, &key_type, &input_character_mode,
- &b_numeric,&b_help_info, &text, &text_len, &duration);
+ &b_numeric, &b_help_info, &text, &text_len, &duration);
#endif
get_inkey.commandId = command_id;
get_inkey.keyType = key_type;
get_inkey.inputCharMode = input_character_mode;
get_inkey.bIsNumeric = (b_numeric ? 1 : 0);
get_inkey.bIsHelpInfoAvailable = (b_help_info ? 1 : 0);
- memcpy(get_inkey.text.string, text, TAPI_SAT_DEF_TEXT_STRING_LEN_MAX+1);
+ memcpy(get_inkey.text.string, text, SAT_TEXT_STRING_LEN_MAX+1);
g_free(text);
get_inkey.text.stringLen = text_len;
get_inkey.duration = duration;
#if defined(TIZEN_SUPPORT_SAT_ICON)
- if(icon_id) {
+ if (icon_id) {
unbox = g_variant_get_variant(icon_id);
g_variant_get(unbox, "a(biiiiiis)", &iter);
- while(g_variant_iter_loop(iter,"(biiiiiis)", &is_exist, &icon_quali, &icon_identifier, &width, &height, &ics, &icon_data_len, &icon_data)) {
- if(!is_exist)
+ while (g_variant_iter_loop(iter, "(biiiiiis)", &is_exist, &icon_quali, &icon_identifier, &width, &height, &ics, &icon_data_len, &icon_data)) {
+ if (!is_exist)
break;
get_inkey.iconId.bIsPresent = is_exist;
get_inkey.iconId.iconQualifier = icon_quali;
get_inkey.iconId.iconInfo.width = width;
get_inkey.iconId.iconInfo.height = height;
get_inkey.iconId.iconInfo.ics = ics;
- if(icon_data_len > 0) {
+ if (icon_data_len > 0) {
get_inkey.iconId.iconInfo.iconDataLen = icon_data_len;
memcpy(get_inkey.iconId.iconInfo.iconFile, icon_data, icon_data_len);
}
}
#endif
cmd_type = g_strdup_printf("%d", SAT_PROATV_CMD_GET_INKEY);
- encoded_data = g_base64_encode((const guchar*)&get_inkey, sizeof(TelSatGetInkeyInd_t));
+ encoded_data = g_base64_encode((const guchar*)&get_inkey, sizeof(struct tel_sat_get_inkey_ind));
bundle_data = bundle_create();
bundle_add(bundle_data, "KEY_EXEC_TYPE", "1");
gboolean rv = FALSE;
bundle *bundle_data = 0;
gchar *encoded_data = NULL, *cmd_type = NULL;
- TelSatGetInputInd_t get_input;
+ struct tel_sat_get_input_ind get_input;
gint command_id, input_character_mode;
gint text_len, def_text_len, rsp_len_min, rsp_len_max;
gchar *icon_data = NULL;
GVariantIter *iter;
#endif
- memset(&get_input, 0, sizeof(TelSatGetInputInd_t));
+ memset(&get_input, 0, sizeof(struct tel_sat_get_input_ind));
#if defined(TIZEN_SUPPORT_SAT_ICON)
g_variant_get(data, "(iibbbsiiisi@v)", &command_id, &input_character_mode, &b_numeric, &b_help_info, &b_echo_input,
get_input.bIsNumeric = (b_numeric ? 1 : 0);
get_input.bIsHelpInfoAvailable = (b_help_info ? 1 : 0);
get_input.bIsEchoInput = (b_echo_input ? 1 : 0);
- memcpy(get_input.text.string, text, TAPI_SAT_DEF_TEXT_STRING_LEN_MAX+1);
+ memcpy(get_input.text.string, text, SAT_TEXT_STRING_LEN_MAX+1);
get_input.text.stringLen = text_len;
get_input.respLen.max = rsp_len_max;
get_input.respLen.min = rsp_len_min;
- memcpy(get_input.defaultText.string, def_text, TAPI_SAT_DEF_TEXT_STRING_LEN_MAX+1);
+ memcpy(get_input.defaultText.string, def_text, SAT_TEXT_STRING_LEN_MAX+1);
get_input.defaultText.stringLen = def_text_len;
g_free(text);
g_free(def_text);
#if defined(TIZEN_SUPPORT_SAT_ICON)
- if(icon_id) {
+ if (icon_id) {
unbox = g_variant_get_variant(icon_id);
g_variant_get(unbox, "a(biiiiiis)", &iter);
- while(g_variant_iter_loop(iter,"(biiiiiis)", &is_exist, &icon_quali, &icon_identifier, &width, &height, &ics, &icon_data_len, &icon_data)) {
- if(!is_exist)
+ while (g_variant_iter_loop(iter, "(biiiiiis)", &is_exist, &icon_quali, &icon_identifier, &width, &height, &ics, &icon_data_len, &icon_data)) {
+ if (!is_exist)
break;
get_input.iconId.bIsPresent = is_exist;
get_input.iconId.iconQualifier = icon_quali;
get_input.iconId.iconInfo.width = width;
get_input.iconId.iconInfo.height = height;
get_input.iconId.iconInfo.ics = ics;
- if(icon_data_len > 0) {
+ if (icon_data_len > 0) {
get_input.iconId.iconInfo.iconDataLen = icon_data_len;
memcpy(get_input.iconId.iconInfo.iconFile, icon_data, icon_data_len);
}
}
#endif
cmd_type = g_strdup_printf("%d", SAT_PROATV_CMD_GET_INPUT);
- encoded_data = g_base64_encode((const guchar*)&get_input, sizeof(TelSatGetInputInd_t));
+ encoded_data = g_base64_encode((const guchar*)&get_input, sizeof(struct tel_sat_get_input_ind));
bundle_data = bundle_create();
bundle_add(bundle_data, "KEY_EXEC_TYPE", "1");
gboolean rv = FALSE;
bundle *bundle_data = 0;
gchar *encoded_data = NULL, *cmd_type = NULL;
- TelSatRefreshIndUiInfo_t refresh_info;
+ struct tel_sat_refresh_ind_ui_info refresh_info;
gint command_id = 0;
- gint refresh_type =0;
+ gint refresh_type = 0;
GVariant *file_list = NULL;
- memset(&refresh_info, 0, sizeof(TelSatRefreshIndUiInfo_t));
+ memset(&refresh_info, 0, sizeof(struct tel_sat_refresh_ind_ui_info));
dbg("refresh type_format(%s)", g_variant_get_type_string(data));
g_variant_get(data, "(ii@v)", &command_id, &refresh_type, &file_list);
refresh_info.refreshType = refresh_type;
cmd_type = g_strdup_printf("%d", SAT_PROATV_CMD_REFRESH);
- encoded_data = g_base64_encode((const guchar*)&refresh_info, sizeof(TelSatRefreshIndUiInfo_t));
+ encoded_data = g_base64_encode((const guchar*)&refresh_info, sizeof(struct tel_sat_refresh_ind_ui_info));
bundle_data = bundle_create();
bundle_add(bundle_data, "KEY_EXEC_TYPE", "1");
gboolean rv = FALSE;
bundle *bundle_data = 0;
gchar *encoded_data = NULL, *cmd_type = NULL;
- TelSatPlayToneInd_t play_tone_info;
+ struct tel_sat_play_tone_ind play_tone_info;
gint command_id, tone_type, duration;
gint text_len;
gchar *icon_data = NULL;
GVariantIter *iter;
#endif
- memset(&play_tone_info, 0, sizeof(TelSatPlayToneInd_t));
+ memset(&play_tone_info, 0, sizeof(struct tel_sat_play_tone_ind));
#if defined(TIZEN_SUPPORT_SAT_ICON)
g_variant_get(data, "(isi@vii)", &command_id, &text, &text_len, &icon_id, &tone_type, &duration);
play_tone_info.commandId = command_id;
play_tone_info.duration = duration;
play_tone_info.text.stringLen = text_len;
- memcpy(play_tone_info.text.string, text, TAPI_SAT_DEF_TEXT_STRING_LEN_MAX+1);
+ memcpy(play_tone_info.text.string, text, SAT_TEXT_STRING_LEN_MAX+1);
g_free(text);
- play_tone_info.tone.type = tone_type;
+ play_tone_info.tone.tone_type = tone_type;
#if defined(TIZEN_SUPPORT_SAT_ICON)
- if(icon_id) {
+ if (icon_id) {
unbox = g_variant_get_variant(icon_id);
g_variant_get(unbox, "a(biiiiiis)", &iter);
- while(g_variant_iter_loop(iter,"(biiiiiis)", &is_exist, &icon_quali, &icon_identifier, &width, &height, &ics, &icon_data_len, &icon_data)) {
- if(!is_exist)
+ while (g_variant_iter_loop(iter, "(biiiiiis)", &is_exist, &icon_quali, &icon_identifier, &width, &height, &ics, &icon_data_len, &icon_data)) {
+ if (!is_exist)
break;
play_tone_info.iconId.bIsPresent = is_exist;
play_tone_info.iconId.iconQualifier = icon_quali;
play_tone_info.iconId.iconInfo.width = width;
play_tone_info.iconId.iconInfo.height = height;
play_tone_info.iconId.iconInfo.ics = ics;
- if(icon_data_len > 0) {
+ if (icon_data_len > 0) {
play_tone_info.iconId.iconInfo.iconDataLen = icon_data_len;
memcpy(play_tone_info.iconId.iconInfo.iconFile, icon_data, icon_data_len);
}
}
#endif
cmd_type = g_strdup_printf("%d", SAT_PROATV_CMD_PLAY_TONE);
- encoded_data = g_base64_encode((const guchar*)&play_tone_info, sizeof(TelSatPlayToneInd_t));
+ encoded_data = g_base64_encode((const guchar*)&play_tone_info, sizeof(struct tel_sat_play_tone_ind));
bundle_data = bundle_create();
bundle_add(bundle_data, "KEY_EXEC_TYPE", "1");
gboolean rv = FALSE;
bundle *bundle_data = 0;
gchar *encoded_data = NULL, *cmd_type = NULL;
- TelSatSetupIdleModeTextInd_t idle_mode_text_info;
+ struct tel_sat_setup_idle_mode_text_ind idle_mode_text_info;
gint command_id, text_len;
gchar* text = NULL;
gchar *icon_data = NULL;
GVariantIter *iter;
#endif
- memset(&idle_mode_text_info, 0, sizeof(TelSatSetupIdleModeTextInd_t));
+ memset(&idle_mode_text_info, 0, sizeof(struct tel_sat_setup_idle_mode_text_ind));
#if defined(TIZEN_SUPPORT_SAT_ICON)
g_variant_get(data, "(isi@v)", &command_id, &text, &text_len, &icon_id);
#endif
idle_mode_text_info.commandId = command_id;
idle_mode_text_info.text.stringLen = text_len;
- memcpy(idle_mode_text_info.text.string, text, TAPI_SAT_DEF_TEXT_STRING_LEN_MAX+1);
+ memcpy(idle_mode_text_info.text.string, text, SAT_TEXT_STRING_LEN_MAX+1);
g_free(text);
#if defined(TIZEN_SUPPORT_SAT_ICON)
- if(icon_id) {
+ if (icon_id) {
unbox = g_variant_get_variant(icon_id);
g_variant_get(unbox, "a(biiiiiis)", &iter);
- while(g_variant_iter_loop(iter,"(biiiiiis)", &is_exist, &icon_quali, &icon_identifier, &width, &height, &ics, &icon_data_len, &icon_data)) {
- if(!is_exist)
+ while (g_variant_iter_loop(iter, "(biiiiiis)", &is_exist, &icon_quali, &icon_identifier, &width, &height, &ics, &icon_data_len, &icon_data)) {
+ if (!is_exist)
break;
idle_mode_text_info.iconId.bIsPresent = is_exist;
idle_mode_text_info.iconId.iconQualifier = icon_quali;
idle_mode_text_info.iconId.iconInfo.width = width;
idle_mode_text_info.iconId.iconInfo.height = height;
idle_mode_text_info.iconId.iconInfo.ics = ics;
- if(icon_data_len > 0) {
+ if (icon_data_len > 0) {
idle_mode_text_info.iconId.iconInfo.iconDataLen = icon_data_len;
memcpy(idle_mode_text_info.iconId.iconInfo.iconFile, icon_data, icon_data_len);
}
}
#endif
cmd_type = g_strdup_printf("%d", SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT);
- encoded_data = g_base64_encode((const guchar*)&idle_mode_text_info, sizeof(TelSatSetupIdleModeTextInd_t));
+ encoded_data = g_base64_encode((const guchar*)&idle_mode_text_info, sizeof(struct tel_sat_setup_idle_mode_text_ind));
bundle_data = bundle_create();
bundle_add(bundle_data, "KEY_EXEC_TYPE", "1");
/* P130527-4589 (I8800): Megafone Russia SIM cards.
* Need to check for debug without execption handling.
*/
- if (rv != TRUE) {
+ if (rv != TRUE)
err("result is error");
- }
return TRUE;
}
gboolean rv = FALSE;
bundle *bundle_data = 0;
gchar *encoded_data = NULL, *cmd_type = NULL;
- TelSatSendUiInfo_t ui_info;
+ struct tel_sat_send_ui_info ui_info;
gint command_id, text_len;
gboolean user_confirm;
GVariant *icon_id = NULL;
GVariantIter *iter;
#endif
- memset(&ui_info, 0, sizeof(TelSatSendUiInfo_t));
+ memset(&ui_info, 0, sizeof(struct tel_sat_send_ui_info));
#if defined(TIZEN_SUPPORT_SAT_ICON)
g_variant_get(data, "(isib@v)", &command_id, &text, &text_len, &user_confirm, &icon_id);
dbg("command_id(%d) data(%s) len(%d) user_confirm(%d)", command_id, text, text_len, user_confirm);
ui_info.commandId = command_id;
- memcpy(ui_info.text.string, text, TAPI_SAT_DEF_TEXT_STRING_LEN_MAX+1);
+ memcpy(ui_info.text.string, text, SAT_TEXT_STRING_LEN_MAX+1);
g_free(text);
ui_info.text.stringLen = text_len;
ui_info.user_confirm = (user_confirm ? 1 : 0);
#if defined(TIZEN_SUPPORT_SAT_ICON)
- if(icon_id) {
+ if (icon_id) {
unbox = g_variant_get_variant(icon_id);
g_variant_get(unbox, "a(biiiiiis)", &iter);
- while(g_variant_iter_loop(iter,"(biiiiiis)", &is_exist, &icon_quali, &icon_identifier, &width, &height, &ics, &icon_data_len, &icon_data)) {
- if(!is_exist)
+ while (g_variant_iter_loop(iter, "(biiiiiis)", &is_exist, &icon_quali, &icon_identifier, &width, &height, &ics, &icon_data_len, &icon_data)) {
+ if (!is_exist)
break;
ui_info.iconId.bIsPresent = is_exist;
ui_info.iconId.iconQualifier = icon_quali;
ui_info.iconId.iconInfo.width = width;
ui_info.iconId.iconInfo.height = height;
ui_info.iconId.iconInfo.ics = ics;
- if(icon_data_len > 0) {
+ if (icon_data_len > 0) {
ui_info.iconId.iconInfo.iconDataLen = icon_data_len;
memcpy(ui_info.iconId.iconInfo.iconFile, icon_data, icon_data_len);
}
}
#endif
cmd_type = g_strdup_printf("%d", cmd);
- encoded_data = g_base64_encode((const guchar*)&ui_info, sizeof(TelSatSendUiInfo_t));
+ encoded_data = g_base64_encode((const guchar*)&ui_info, sizeof(struct tel_sat_send_ui_info));
bundle_data = bundle_create();
bundle_add(bundle_data, "KEY_EXEC_TYPE", "1");
snprintf(slot_info, 2, "%d", slot_id);
dbg("slot_id : [%s]", slot_info);
- switch(cmd_type){
- case SAT_PROATV_CMD_NONE:
- case SAT_PROATV_CMD_SEND_DTMF:
- case SAT_PROATV_CMD_LAUNCH_BROWSER:
- case SAT_PROATV_CMD_SEND_SMS:
- result = _sat_ui_support_processing_ui_info_ind(cmd_type, data, slot_info);
- break;
- case SAT_PROATV_CMD_SETUP_MENU:
- result = _sat_ui_support_processing_setup_menu_ind(data, slot_info);
- break;
- case SAT_PROATV_CMD_DISPLAY_TEXT:
- result = _sat_ui_support_processing_display_text_ind(data, slot_info);
- break;
- case SAT_PROATV_CMD_SELECT_ITEM:
- result = _sat_ui_support_processing_select_item_ind(data, slot_info);
- break;
- case SAT_PROATV_CMD_GET_INKEY:
- result = _sat_ui_support_processing_get_inkey_ind(data, slot_info);
- break;
- case SAT_PROATV_CMD_GET_INPUT:
- result = _sat_ui_support_processing_get_input_ind(data, slot_info);
- break;
- case SAT_PROATV_CMD_REFRESH:
- result = _sat_ui_support_processing_refresh_ind(data, slot_info);
- break;
- case SAT_PROATV_CMD_PLAY_TONE:
- result = _sat_ui_support_processing_play_tone_ind(data, slot_info);
- break;
- case SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT:
- result = _sat_ui_support_processing_idle_mode_text_ind(data, slot_info);
- break;
- case SAT_PROATV_CMD_SETUP_EVENT_LIST:
- break;
- default:
- dbg("does not need to launch sat-ui");
- break;
+ switch (cmd_type) {
+ case SAT_PROATV_CMD_NONE:
+ case SAT_PROATV_CMD_SEND_DTMF:
+ case SAT_PROATV_CMD_LAUNCH_BROWSER:
+ case SAT_PROATV_CMD_SEND_SMS:
+ result = _sat_ui_support_processing_ui_info_ind(cmd_type, data, slot_info);
+ break;
+ case SAT_PROATV_CMD_SETUP_MENU:
+ result = _sat_ui_support_processing_setup_menu_ind(data, slot_info);
+ break;
+ case SAT_PROATV_CMD_DISPLAY_TEXT:
+ result = _sat_ui_support_processing_display_text_ind(data, slot_info);
+ break;
+ case SAT_PROATV_CMD_SELECT_ITEM:
+ result = _sat_ui_support_processing_select_item_ind(data, slot_info);
+ break;
+ case SAT_PROATV_CMD_GET_INKEY:
+ result = _sat_ui_support_processing_get_inkey_ind(data, slot_info);
+ break;
+ case SAT_PROATV_CMD_GET_INPUT:
+ result = _sat_ui_support_processing_get_input_ind(data, slot_info);
+ break;
+ case SAT_PROATV_CMD_REFRESH:
+ result = _sat_ui_support_processing_refresh_ind(data, slot_info);
+ break;
+ case SAT_PROATV_CMD_PLAY_TONE:
+ result = _sat_ui_support_processing_play_tone_ind(data, slot_info);
+ break;
+ case SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT:
+ result = _sat_ui_support_processing_idle_mode_text_ind(data, slot_info);
+ break;
+ case SAT_PROATV_CMD_SETUP_EVENT_LIST:
+ break;
+ default:
+ dbg("does not need to launch sat-ui");
+ break;
}
return result;
}
-gboolean sat_ui_support_launch_call_application(enum tel_sat_proactive_cmd_type cmd_type, GVariant *data, enum dbus_tapi_sim_slot_id slot_id)
-{
- char buffer[300];
- char slot_info[2] = {0,};
- bundle *bundle_data = 0;
-
- dbg("launch call application by aul");
- bundle_data = bundle_create();
-
- appsvc_set_operation(bundle_data, APPSVC_OPERATION_CALL);
- appsvc_set_uri(bundle_data,"tel:MT");
-
- switch(cmd_type){
- case SAT_PROATV_CMD_SETUP_CALL:{
- gint command_id, call_type, confirm_text_len, text_len, duration;
- gchar *confirm_text = NULL, *text = NULL, *call_number = NULL;
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- GVariant *icon_id;
-#endif
- dbg("setup call type_format(%s)", g_variant_get_type_string(data));
-#if defined(TIZEN_SUPPORT_SAT_ICON)
- g_variant_get(data, "(isisi@visi)", &command_id, &confirm_text, &confirm_text_len, &text, &text_len, &icon_id, &call_type, &call_number, &duration);
-#else
- g_variant_get(data, "(isisiisi)", &command_id, &confirm_text, &confirm_text_len, &text, &text_len, &call_type, &call_number, &duration);
-#endif
- appsvc_add_data(bundle_data, "launch-type","SATSETUPCALL");
-
- snprintf(buffer, 300, "%d",command_id);
- appsvc_add_data(bundle_data, "cmd_id",buffer);
- dbg("cmd_id(%s)",buffer);
-
- snprintf(buffer, 300, "%d",call_type);
- appsvc_add_data(bundle_data, "cmd_qual", buffer);
- dbg("cmd_qual(%s)",buffer);
-
- snprintf(buffer, 300, "%s", text);
- appsvc_add_data(bundle_data, "disp_text", buffer);
- dbg("disp_text(%s)",buffer);
-
- snprintf(buffer, 300, "%s", call_number);
- appsvc_add_data(bundle_data, "call_num", buffer);
- dbg("call_num(%s)",buffer);
-
- snprintf(buffer, 300, "%d", duration);
- appsvc_add_data(bundle_data, "dur", buffer);
- dbg("dur(%s)",buffer);
-
- g_free(confirm_text);
- g_free(text);
- g_free(call_number);
- } break;
-
- default:
- bundle_free(bundle_data);
- return FALSE;
- break;
- }
-
- snprintf(slot_info, 2, "%d", slot_id);
- appsvc_add_data(bundle_data, "slot_id", slot_info);
- dbg("slot_id : [%s]", slot_info);
-
- appsvc_run_service(bundle_data, 0, NULL, NULL);
- dbg("call app is called");
- bundle_free(bundle_data);
-
- return TRUE;
-}
-
gboolean sat_ui_support_launch_browser_application(enum tel_sat_proactive_cmd_type cmd_type, GVariant *data, enum dbus_tapi_sim_slot_id slot_id)
{
char buffer[300];
dbg("launch browser application by aul");
bundle_data = bundle_create();
- appsvc_set_operation(bundle_data, APPSVC_OPERATION_VIEW);
+ appsvc_set_pkgname(bundle_data, "org.tizen.browser");
- switch(cmd_type){
- case SAT_PROATV_CMD_LAUNCH_BROWSER:{
- gint command_id, launch_type, browser_id;
- gint url_len, text_len, gateway_proxy_len;
- gchar *url = NULL, *text = NULL, *gateway_proxy = NULL;
+ switch (cmd_type) {
+ case SAT_PROATV_CMD_LAUNCH_BROWSER: {
+ gint command_id, launch_type, browser_id;
+ gint url_len, text_len, gateway_proxy_len;
+ gchar *url = NULL, *text = NULL, *gateway_proxy = NULL;
#if defined(TIZEN_SUPPORT_SAT_ICON)
- GVariant *icon_id = NULL;
+ GVariant *icon_id = NULL;
#endif
- dbg("launch_browser type_format(%s)", g_variant_get_type_string(data));
+ dbg("launch_browser type_format(%s)", g_variant_get_type_string(data));
#if defined(TIZEN_SUPPORT_SAT_ICON)
- g_variant_get(data, "(iiisisisi@v)", &command_id, &launch_type, &browser_id, &url, &url_len, &gateway_proxy, &gateway_proxy_len, &text, &text_len, &icon_id);
+ g_variant_get(data, "(iiisisisi@v)", &command_id, &launch_type, &browser_id, &url, &url_len, &gateway_proxy, &gateway_proxy_len, &text, &text_len, &icon_id);
#else
- g_variant_get(data, "(iiisisisi)", &command_id, &launch_type, &browser_id, &url, &url_len, &gateway_proxy, &gateway_proxy_len, &text, &text_len);
+ g_variant_get(data, "(iiisisisi)", &command_id, &launch_type, &browser_id, &url, &url_len, &gateway_proxy, &gateway_proxy_len, &text, &text_len);
#endif
- if(!url || strlen(url) < 7){
- g_free(url);
- url = g_strdup("http://");
- }
- dbg("url (%s)", url);
- appsvc_set_uri(bundle_data, url);
+ if (!url || strlen(url) < 7) {
g_free(url);
+ url = g_strdup("http://");
+ }
+ dbg("url (%s)", url);
+ appsvc_set_uri(bundle_data, url);
+ g_free(url);
- snprintf(buffer, 300, "%d",TRUE);
- appsvc_add_data(bundle_data, "sat",buffer);
-
- snprintf(buffer, 300, "%d",command_id);
- appsvc_add_data(bundle_data, "cmd_id",buffer);
- dbg("cmd_id(%s)",buffer);
+ snprintf(buffer, 300, "%d", TRUE);
+ appsvc_add_data(bundle_data, "sat", buffer);
- snprintf(buffer, 300, "%d",launch_type);
- appsvc_add_data(bundle_data, "launch_type", buffer);
- dbg("launch_type(%s)",buffer);
+ snprintf(buffer, 300, "%d", command_id);
+ appsvc_add_data(bundle_data, "cmd_id", buffer);
+ dbg("cmd_id(%s)", buffer);
- snprintf(buffer, 300, "%s", gateway_proxy);
- appsvc_add_data(bundle_data, "proxy", buffer);
- dbg("proxy(%s)",buffer);
+ snprintf(buffer, 300, "%d", launch_type);
+ appsvc_add_data(bundle_data, "launch_type", buffer);
+ dbg("launch_type(%s)", buffer);
- g_free(text);
- g_free(gateway_proxy);
+ snprintf(buffer, 300, "%s", gateway_proxy);
+ appsvc_add_data(bundle_data, "proxy", buffer);
+ dbg("proxy(%s)", buffer);
- } break;
+ g_free(text);
+ g_free(gateway_proxy);
+ } break;
- default:
- bundle_free(bundle_data);
- return FALSE;
- break;
+ default:
+ bundle_free(bundle_data);
+ return FALSE;
+ break;
}
snprintf(slot_info, 2, "%d", slot_id);
dbg("launch ciss application by aul");
bundle_data = bundle_create();
- appsvc_set_pkgname(bundle_data, "org.tizen.ciss");
-
- switch(cmd_type){
- case SAT_PROATV_CMD_SEND_SS:{
- TelSatSendSsIndSsData_t ss_info;
-
- gint command_id, ton, npi;
- gint text_len, ss_str_len;
- gchar* text = NULL, *ss_string = NULL;
+ appsvc_set_pkgname(bundle_data, CISS_APP);
+
+ switch (cmd_type) {
+ case SAT_PROATV_CMD_SEND_SS: {
+ struct tel_sat_send_ss_ind_ss_data ss_info;
+ gint command_id, ton, npi;
+ gint text_len, ss_str_len;
+ gchar* text = NULL, *ss_string = NULL;
#if defined(TIZEN_SUPPORT_SAT_ICON)
- GVariant *icon_id;
+ GVariant *icon_id;
#endif
- dbg("launch ciss ui for send ss proactive cmd");
+ dbg("launch ciss ui for send ss proactive cmd");
- memset(&ss_info, 0, sizeof(TelSatSendSsIndSsData_t));
+ memset(&ss_info, 0, sizeof(struct tel_sat_send_ss_ind_ss_data));
- dbg("send ss type_format(%s)", g_variant_get_type_string(data));
+ dbg("send ss type_format(%s)", g_variant_get_type_string(data));
#if defined(TIZEN_SUPPORT_SAT_ICON)
- g_variant_get(data, "(isi@viiis)", &command_id, &text, &text_len, &icon_id, &ton, &npi, &ss_str_len, &ss_string);
+ g_variant_get(data, "(isi@viiis)", &command_id, &text, &text_len, &icon_id, &ton, &npi, &ss_str_len, &ss_string);
#else
- g_variant_get(data, "(isiiiis)", &command_id, &text, &text_len, &ton, &npi, &ss_str_len, &ss_string);
+ g_variant_get(data, "(isiiiis)", &command_id, &text, &text_len, &ton, &npi, &ss_str_len, &ss_string);
#endif
- ss_info.commandId = command_id;
- ss_info.ton = ton;
- ss_info.npi = npi;
- memcpy(ss_info.ssString, ss_string, TAPI_SAT_DEF_SS_LEN_MAX+1);
- ss_info.ssStringLen = ss_str_len;
- g_free(text);
- g_free(ss_string);
-
- cmd = g_strdup_printf("%d", cmd_type);
- encoded_data = g_base64_encode((const guchar*)&ss_info, sizeof(TelSatSendSsIndSsData_t));
- } break;
-
- case SAT_PROATV_CMD_SEND_USSD:{
- TelSatSendUssdIndUssdData_t ussd_info;
-
- gint command_id;
- gint text_len, ussd_str_len;
- guchar dcs;
- gchar* text = NULL, *ussd_string = NULL;
+ ss_info.commandId = command_id;
+ ss_info.ton = ton;
+ ss_info.npi = npi;
+ memcpy(ss_info.ssString, ss_string, SAT_SS_STRING_LEN_MAX+1);
+ ss_info.ssStringLen = ss_str_len;
+ g_free(text);
+ g_free(ss_string);
+
+ cmd = g_strdup_printf("%d", cmd_type);
+ encoded_data = g_base64_encode((const guchar*)&ss_info, sizeof(struct tel_sat_send_ss_ind_ss_data));
+ } break;
+
+ case SAT_PROATV_CMD_SEND_USSD:{
+ struct tel_sat_send_ussd_ind_ussd_data ussd_info;
+ gint command_id;
+ gint text_len, ussd_str_len;
+ guchar dcs;
+ gchar* text = NULL, *ussd_string = NULL;
#if defined(TIZEN_SUPPORT_SAT_ICON)
- GVariant *icon_id;
+ GVariant *icon_id;
#endif
- dbg("launch ciss ui for send ussd proactive cmd");
+ dbg("launch ciss ui for send ussd proactive cmd");
- memset(&ussd_info, 0, sizeof(TelSatSendUssdIndUssdData_t));
+ memset(&ussd_info, 0, sizeof(struct tel_sat_send_ussd_ind_ussd_data));
- dbg("send ussd type_format(%s)", g_variant_get_type_string(data));
+ dbg("send ussd type_format(%s)", g_variant_get_type_string(data));
#if defined(TIZEN_SUPPORT_SAT_ICON)
- g_variant_get(data, "(isi@vyis)", &command_id, &text, &text_len, &icon_id, &dcs, &ussd_str_len, &ussd_string);
+ g_variant_get(data, "(isi@vyis)", &command_id, &text, &text_len, &icon_id, &dcs, &ussd_str_len, &ussd_string);
#else
- g_variant_get(data, "(isiyis)", &command_id, &text, &text_len, &dcs, &ussd_str_len, &ussd_string);
+ g_variant_get(data, "(isiyis)", &command_id, &text, &text_len, &dcs, &ussd_str_len, &ussd_string);
#endif
- ussd_info.commandId = command_id;
- ussd_info.rawDcs = dcs;
- memcpy(ussd_info.ussdString, ussd_string, TAPI_SAT_DEF_USSD_LEN_MAX+1);
- ussd_info.ussdStringLen = ussd_str_len;
- g_free(text);
- g_free(ussd_string);
-
- cmd = g_strdup_printf("%d", cmd_type);
- encoded_data = g_base64_encode((const guchar*)&ussd_info, sizeof(TelSatSendUssdIndUssdData_t));
- } break;
-
- default:
- bundle_free(bundle_data);
- return FALSE;
- break;
+ ussd_info.commandId = command_id;
+ ussd_info.rawDcs = dcs;
+ memcpy(ussd_info.ussdString, ussd_string, SAT_USSD_STRING_LEN_MAX+1);
+ ussd_info.ussdStringLen = ussd_str_len;
+ g_free(text);
+ g_free(ussd_string);
+
+ cmd = g_strdup_printf("%d", cmd_type);
+ encoded_data = g_base64_encode((const guchar*)&ussd_info, sizeof(struct tel_sat_send_ussd_ind_ussd_data));
+ } break;
+
+ default:
+ bundle_free(bundle_data);
+ return FALSE;
+ break;
}
snprintf(slot_info, 2, "%d", slot_id);
return TRUE;
}
+gboolean sat_ui_support_launch_eventdownloader_application(GVariant *data, enum dbus_tapi_sim_slot_id slot_id)
+{
+ bundle *bundle_data = 0;
+ gchar *encoded_data = NULL;
+ struct tel_sat_event_list eventinfo;
+ guchar event_count;
+ GVariant *sat_event_list;
+ GVariant *unbox;
+ GVariantIter *iter;
+ unsigned int local_index = 0;
+ gint event_id = 0;
+
+ dbg("Launch SAT Event Downloader application by aul");
+ bundle_data = bundle_create();
+
+ if (slot_id == SIM_SLOT_PRIMARY) {
+ appsvc_set_pkgname(bundle_data, EVENT_DOWNLOADER_SLOT1);
+ } else if(slot_id == SIM_SLOT_SECONDARY) {
+ appsvc_set_pkgname(bundle_data, EVENT_DOWNLOADER_SLOT2);
+ } else {
+ err("wrong slot info");
+ if(bundle_data)
+ bundle_free(bundle_data);
+ return FALSE;
+ }
+ memset(&eventinfo, 0, sizeof(struct tel_sat_event_list));
+
+ dbg("sat event download type_format(%s)", g_variant_get_type_string(data));
+ g_variant_get(data, "(y@v)", &event_count, &sat_event_list);
+
+ eventinfo.event_list_cnt = event_count;
+ if (eventinfo.event_list_cnt > 0) {
+ unbox = g_variant_get_variant(sat_event_list);
+
+ g_variant_get(unbox, "ai", &iter);
+ while (g_variant_iter_loop(iter, "i", &event_id)) {
+ eventinfo.evt_list[local_index] = event_id;
+ local_index++;
+ }
+ g_variant_iter_free(iter);
+ }
+
+ encoded_data = g_base64_encode((const guchar*)&eventinfo, sizeof(struct tel_sat_event_list));
+
+ appsvc_add_data(bundle_data, "EVENT_LIST_DATA", encoded_data);
+ g_free(encoded_data);
+
+ appsvc_run_service(bundle_data, 0, NULL, NULL);
+ dbg("event downloader app is called");
+ bundle_free(bundle_data);
+
+ return TRUE;
+
+}
+
+
gboolean sat_ui_support_launch_setting_application(enum tel_sat_proactive_cmd_type cmd_type, GVariant *data, enum dbus_tapi_sim_slot_id slot_id)
{
gint rv;
/*TODO : need to make a sync with app engineer*/
- switch(cmd_type){
- case SAT_PROATV_CMD_LANGUAGE_NOTIFICATION:{
- gint command_id, call_type, text_len, duration;
- gchar *text = NULL, *call_number = NULL;
+ switch (cmd_type) {
+ case SAT_PROATV_CMD_LANGUAGE_NOTIFICATION: {
+ gint command_id, call_type, text_len, duration;
+ gchar *text = NULL, *call_number = NULL;
#if defined(TIZEN_SUPPORT_SAT_ICON)
- GVariant *icon_id;
+ GVariant *icon_id;
#endif
- dbg("setup call type_format(%s)", g_variant_get_type_string(data));
+ dbg("setup call type_format(%s)", g_variant_get_type_string(data));
#if defined(TIZEN_SUPPORT_SAT_ICON)
- g_variant_get(data, "(isi@visi)", &command_id, &text, &text_len, &icon_id, &call_type, &call_number, &duration);
+ g_variant_get(data, "(isi@visi)", &command_id, &text, &text_len, &icon_id, &call_type, &call_number, &duration);
#else
- g_variant_get(data, "(isiisi)", &command_id, &text, &text_len, &call_type, &call_number, &duration);
+ g_variant_get(data, "(isiisi)", &command_id, &text, &text_len, &call_type, &call_number, &duration);
#endif
- bundle_add(bundle_data, "launch-type","SATSETUPCALL");
+ bundle_add(bundle_data, "launch-type", "SATSETUPCALL");
- snprintf(buffer, 300, "%d",command_id);
- bundle_add(bundle_data, "cmd_id",buffer);
- dbg("cmd_id(%s)",buffer);
+ snprintf(buffer, 300, "%d", command_id);
+ bundle_add(bundle_data, "cmd_id", buffer);
+ dbg("cmd_id(%s)", buffer);
- snprintf(buffer, 300, "%d",call_type);
- bundle_add(bundle_data, "cmd_qual", buffer);
- dbg("cmd_qual(%s)",buffer);
+ snprintf(buffer, 300, "%d", call_type);
+ bundle_add(bundle_data, "cmd_qual", buffer);
+ dbg("cmd_qual(%s)", buffer);
- snprintf(buffer, 300, "%s", text);
- bundle_add(bundle_data, "disp_text", buffer);
- dbg("disp_text(%s)",buffer);
+ snprintf(buffer, 300, "%s", text);
+ bundle_add(bundle_data, "disp_text", buffer);
+ dbg("disp_text(%s)", buffer);
- snprintf(buffer, 300, "%s", call_number);
- bundle_add(bundle_data, "call_num", buffer);
- dbg("call_num(%s)",buffer);
+ snprintf(buffer, 300, "%s", call_number);
+ bundle_add(bundle_data, "call_num", buffer);
+ dbg("call_num(%s)", buffer);
- snprintf(buffer, 300, "%d", duration);
- bundle_add(bundle_data, "dur", buffer);
- dbg("dur(%s)",buffer);
+ snprintf(buffer, 300, "%d", duration);
+ bundle_add(bundle_data, "dur", buffer);
+ dbg("dur(%s)", buffer);
- g_free(text);
- g_free(call_number);
- } break;
+ g_free(text);
+ g_free(call_number);
+ } break;
- case SAT_PROATV_CMD_PROVIDE_LOCAL_INFO:
- break;
+ case SAT_PROATV_CMD_PROVIDE_LOCAL_INFO:
+ break;
- default:
- return FALSE;
+ default:
+ return FALSE;
break;
}
dbg("slot_id : [%s]", slot_info);
bundle_add(bundle_data, "slot_id", slot_info);
- rv = aul_launch_app("org.tizen.call",bundle_data);
+ rv = aul_launch_app("org.tizen.call", bundle_data);
dbg("rv of aul_launch_app()=[%d]", rv);
bundle_free(bundle_data);
gchar *signal_name = NULL;
GVariant *out_param = NULL;
- switch(cmd_type){
- case SAT_PROATV_CMD_OPEN_CHANNEL:{
- gint command_id, bearer_type, protocol_type, dest_addr_type;
- gboolean immediate_link, auto_reconnection, bg_mode;
- gint text_len, buffer_size, port_number;
- gchar *text = NULL, *dest_address = NULL;
- GVariant *bearer_param;
- GVariant *bearer_detail;
+ switch (cmd_type) {
+ case SAT_PROATV_CMD_OPEN_CHANNEL:{
+ gint command_id, bearer_type, protocol_type, dest_addr_type;
+ gboolean immediate_link, auto_reconnection, bg_mode;
+ gint text_len, buffer_size, port_number;
+ gchar *text = NULL, *dest_address = NULL;
+ GVariant *bearer_param;
+ GVariant *bearer_detail;
#if defined(TIZEN_SUPPORT_SAT_ICON)
- GVariant *icon_id;
+ GVariant *icon_id;
#endif
- dbg("open channel type_format(%s)", g_variant_get_type_string(data));
+ dbg("open channel type_format(%s)", g_variant_get_type_string(data));
#if defined(TIZEN_SUPPORT_SAT_ICON)
- g_variant_get(data,"(isi@vbbbiviiiisv)", &command_id, &text, &text_len, &icon_id, &immediate_link, &auto_reconnection, &bg_mode,
- &bearer_type, &bearer_param, &buffer_size, &protocol_type, &port_number, &dest_addr_type, &dest_address, &bearer_detail);
+ g_variant_get(data, "(isi@vbbbiviiiisv)", &command_id, &text,
+ &text_len, &icon_id, &immediate_link, &auto_reconnection,
+ &bg_mode, &bearer_type, &bearer_param, &buffer_size,
+ &protocol_type, &port_number, &dest_addr_type, &dest_address, &bearer_detail);
#else
- g_variant_get(data,"(isibbbiviiiisv)", &command_id, &text, &text_len, &immediate_link, &auto_reconnection, &bg_mode,
- &bearer_type, &bearer_param, &buffer_size, &protocol_type, &port_number, &dest_addr_type, &dest_address, &bearer_detail);
+ g_variant_get(data, "(isibbbiviiiisv)", &command_id, &text,
+ &text_len, &immediate_link, &auto_reconnection, &bg_mode,
+ &bearer_type, &bearer_param, &buffer_size, &protocol_type,
+ &port_number, &dest_addr_type, &dest_address, &bearer_detail);
#endif
- out_param = g_variant_new("(isibbbiviiiisv)", command_id, text, text_len, immediate_link, auto_reconnection, bg_mode,
- bearer_type, bearer_param, buffer_size, protocol_type, port_number, dest_addr_type, dest_address, bearer_detail);
- signal_name = g_strdup("OpenChannel");
-
- g_free(text);
- g_free(dest_address);
- } break;
- case SAT_PROATV_CMD_CLOSE_CHANNEL:{
- gint command_id, channel_id, text_len;
- gchar *text = NULL;
+ out_param = g_variant_new("(isibbbiviiiisv)", command_id, text,
+ text_len, immediate_link, auto_reconnection, bg_mode,
+ bearer_type, bearer_param, buffer_size, protocol_type,
+ port_number, dest_addr_type, dest_address, bearer_detail);
+ signal_name = g_strdup("OpenChannel");
+
+ g_free(text);
+ g_free(dest_address);
+ } break;
+ case SAT_PROATV_CMD_CLOSE_CHANNEL:{
+ gint command_id, channel_id, text_len;
+ gchar *text = NULL;
#if defined(TIZEN_SUPPORT_SAT_ICON)
- GVariant *icon_id;
+ GVariant *icon_id;
#endif
- dbg("close channel type_format(%s)", g_variant_get_type_string(data));
+ dbg("close channel type_format(%s)", g_variant_get_type_string(data));
#if defined(TIZEN_SUPPORT_SAT_ICON)
- g_variant_get(data, "(isi@vi)", &command_id, &text, &text_len, &icon_id, &channel_id);
+ g_variant_get(data, "(isi@vi)", &command_id, &text, &text_len, &icon_id, &channel_id);
#else
- g_variant_get(data, "(isii)", &command_id, &text, &text_len, &channel_id);
+ g_variant_get(data, "(isii)", &command_id, &text, &text_len, &channel_id);
#endif
- out_param = g_variant_new("(isii)", command_id, text, text_len, channel_id);
- signal_name = g_strdup("CloseChannel");
-
- g_free(text);
- } break;
- case SAT_PROATV_CMD_RECEIVE_DATA:{
- gint command_id, text_len, channel_id, channel_data_len = 0;
- gchar *text = NULL;
+ out_param = g_variant_new("(isii)", command_id, text, text_len, channel_id);
+ signal_name = g_strdup("CloseChannel");
+
+ g_free(text);
+ } break;
+ case SAT_PROATV_CMD_RECEIVE_DATA:{
+ gint command_id, text_len, channel_id, channel_data_len = 0;
+ gchar *text = NULL;
#if defined(TIZEN_SUPPORT_SAT_ICON)
- GVariant *icon_id;
+ GVariant *icon_id;
#endif
- dbg("receive data type_format(%s)", g_variant_get_type_string(data));
+ dbg("receive data type_format(%s)", g_variant_get_type_string(data));
#if defined(TIZEN_SUPPORT_SAT_ICON)
- g_variant_get(data, "(isi@vii)", &command_id, &text, &text_len, &icon_id, &channel_id, &channel_data_len);
+ g_variant_get(data, "(isi@vii)", &command_id, &text, &text_len, &icon_id, &channel_id, &channel_data_len);
#else
- g_variant_get(data, "(isiii)", &command_id, &text, &text_len, &channel_id, &channel_data_len);
+ g_variant_get(data, "(isiii)", &command_id, &text, &text_len, &channel_id, &channel_data_len);
#endif
- out_param = g_variant_new("(isiii)", command_id, text, text_len, channel_id, channel_data_len);
- signal_name = g_strdup("ReceiveData");
-
- g_free(text);
- } break;
- case SAT_PROATV_CMD_SEND_DATA:{
- gint command_id, channel_id, text_len, channel_data_len;
- gboolean send_data_immediately;
- gchar *text = NULL;
- GVariant *channel_data;
+ out_param = g_variant_new("(isiii)", command_id, text, text_len, channel_id, channel_data_len);
+ signal_name = g_strdup("ReceiveData");
+
+ g_free(text);
+ } break;
+ case SAT_PROATV_CMD_SEND_DATA:{
+ gint command_id, channel_id, text_len, channel_data_len;
+ gboolean send_data_immediately;
+ gchar *text = NULL;
+ GVariant *channel_data;
#if defined(TIZEN_SUPPORT_SAT_ICON)
- GVariant *icon_id;
+ GVariant *icon_id;
#endif
- dbg("send data type_format(%s)", g_variant_get_type_string(data));
+ dbg("send data type_format(%s)", g_variant_get_type_string(data));
#if defined(TIZEN_SUPPORT_SAT_ICON)
- g_variant_get(data, "(isi@vibvi)", &command_id, &text, &text_len, &icon_id, &channel_id, &send_data_immediately, &channel_data, &channel_data_len);
+ g_variant_get(data, "(isi@vibvi)", &command_id, &text,
+ &text_len, &icon_id, &channel_id, &send_data_immediately,
+ &channel_data, &channel_data_len);
#else
- g_variant_get(data, "(isiibvi)", &command_id, &text, &text_len, &channel_id, &send_data_immediately, &channel_data, &channel_data_len);
+ g_variant_get(data, "(isiibvi)", &command_id, &text,
+ &text_len, &channel_id, &send_data_immediately,
+ &channel_data, &channel_data_len);
#endif
- out_param = g_variant_new("(isiibvi)", command_id, text, text_len, channel_id, send_data_immediately, channel_data, channel_data_len);
- signal_name = g_strdup("SendData");
-
- g_free(text);
- } break;
- case SAT_PROATV_CMD_GET_CHANNEL_STATUS:{
- gint command_id;
-
- dbg("get channel status type_format(%s)", g_variant_get_type_string(data));
- g_variant_get(data, "(i)", &command_id);
-
- out_param = g_variant_new("(i)", command_id);
- signal_name = g_strdup("GetChannelStatus");
- } break;
- case SAT_PROATV_CMD_SETUP_EVENT_LIST:{
- gint event_cnt;
- GVariant *evt_list;
-
- dbg("setup event list type_format(%s)", g_variant_get_type_string(data));
- g_variant_get(data, "(iv)", &event_cnt, &evt_list);
-
- out_param = g_variant_new("(iv)", event_cnt, evt_list);
- signal_name = g_strdup("SetupEventList");
- } break;
- default:
- dbg("no matched command");
- return FALSE;
- break;
- }
-
- dbg("dbus conn(%p), path(%s)", connection, path);
- rv = g_dbus_connection_emit_signal(connection, "org.tizen.bip-manager", path, "org.tizen.telephony.SAT", signal_name, out_param, NULL);
- g_free(signal_name);
-
- dbg("send signal to bip-mananger result (%d)", rv);
-
- return rv;
-}
-
-gboolean sat_ui_support_exec_evtdw(GDBusConnection *connection, const gchar *path, enum tel_sat_proactive_cmd_type cmd_type, GVariant *data)
-{
- gboolean rv = FALSE;
- gchar *signal_name = NULL;
- GVariant *out_param = NULL;
- gchar *interface_name = NULL;
- gint event_cnt;
- GVariant *evt_list;
+ out_param = g_variant_new("(isiibvi)", command_id, text,
+ text_len, channel_id, send_data_immediately, channel_data, channel_data_len);
+ signal_name = g_strdup("SendData");
- dbg("dbus conn(%p), path(%s)", connection, path);
+ g_free(text);
+ } break;
+ case SAT_PROATV_CMD_GET_CHANNEL_STATUS:{
+ gint command_id;
- if(g_str_has_suffix(path , "0")){
- interface_name = g_strdup("org.tizen.sat-event-downloader");
+ dbg("get channel status type_format(%s)", g_variant_get_type_string(data));
+ g_variant_get(data, "(i)", &command_id);
- } else if (g_str_has_suffix(path , "1")){
- interface_name = g_strdup("org.tizen.sat-event-downloader-2");
- } else {
- err("invalid sim slot id");
- return FALSE;
- }
+ out_param = g_variant_new("(i)", command_id);
+ signal_name = g_strdup("GetChannelStatus");
+ } break;
+ case SAT_PROATV_CMD_SETUP_EVENT_LIST:{
+ gint event_cnt;
+ GVariant *evt_list;
- if (cmd_type == SAT_PROATV_CMD_SETUP_EVENT_LIST){
dbg("setup event list type_format(%s)", g_variant_get_type_string(data));
- g_variant_get(data, "(iv)", &event_cnt, &evt_list);
+ g_variant_get(data, "(y@v)", &event_cnt, &evt_list);
- out_param = g_variant_new("(iv)", event_cnt, evt_list);
+ out_param = g_variant_new("(yv)", event_cnt, evt_list);
signal_name = g_strdup("SetupEventList");
- } else {
- err("invalid cmd_type:[%d]", cmd_type);
- g_free(interface_name);
+ } break;
+ default:
+ dbg("no matched command");
return FALSE;
+ break;
}
- rv = g_dbus_connection_emit_signal(connection, interface_name, path, "org.tizen.telephony.SAT", signal_name, out_param, NULL);
- dbg("send signal to sat-event-downloader result (%d)", rv);
-
- g_free(interface_name);
+ dbg("dbus conn(%p), path(%s)", connection, path);
+ rv = g_dbus_connection_emit_signal(connection, "org.tizen.bip-manager", path, "org.tizen.telephony.SAT", signal_name, out_param, NULL);
g_free(signal_name);
+
+ dbg("send signal to bip-mananger result (%d)", rv);
+
return rv;
}
+
-#ifndef SAT_UI_SUPPORT_H_
-#define SAT_UI_SUPPORT_H_
+/*
+ * tel-plugin-dbus-tapi
+ *
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Ja-young Gu <jygu@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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 __SAT_UI_SUPPORT_H__
+#define __SAT_UI_SUPPORT_H__
#include <glib.h>
#include <gio/gio.h>
#include <tcore.h>
#include <storage.h>
#include <server.h>
-#include <type/sat.h>
-#include "../common.h"
+#include "../dtapi_common.h"
#define PKG_ID_SAT_UI "org.tizen.sat-ui"
#define PKG_ID_SAT_UI_2 "org.tizen.sat-ui-2"
#define RELAUNCH_INTERVAL 50*1000 //100ms
#define RETRY_MAXCOUNT 3
+/**
+ * @brief The structure type defining menu item info for the setup menu.
+ * @since_tizen 2.3
+ */
+struct tel_sat_menu_info {
+ char itemString[SAT_DEF_ITEM_STR_LEN_MAX + 6]; /**< menu item character data */
+ char itemId; /**< identifies the item on the menu that user selected */
+};
+
+/**
+ * @brief The structure type defining the icon data object.
+ * @since_tizen 2.3
+ */
+struct tel_sat_icon_identifier_info {
+ int bIsPresent; /**< Flag for checking whether the icon identifier exists */
+ enum icon_qualifier iconQualifier; /**< Icon qualifier type */
+ unsigned char iconIdentifier; /**< Icon identifier */
+ struct tel_sat_icon iconInfo; /**< Icon info */
+};
+
+/**
+ * @brief The structure type defining the icon identifier data object.
+ * @since_tizen 2.3
+ */
+struct tel_sat_icon_identifier_list_info {
+ int bIsPresent; /**< Flag for checking whether the icon identifier exists */
+ enum icon_qualifier iconListQualifier; /**< Icon list qualifier */
+ unsigned char iconCount; /**< Icon count */
+ unsigned char iconIdentifierList[SAT_ICON_LIST_MAX_COUNT]; /**< Icon identifier list */
+ struct tel_sat_icon iconInfo[SAT_ICON_LIST_MAX_COUNT]; /**< Icon list info */
+};
+
+/**
+ * @brief The structure type defining SAT main menu info.
+ * @since_tizen 2.3
+ */
+struct tel_sat_setup_menu_info {
+ int commandId; /**< Proactive Command Number sent by USIM */
+ int bIsMainMenuPresent;
+ char satMainTitle[SAT_ALPHA_ID_LEN_MAX + 1]; /**< menu title text */
+ struct tel_sat_menu_info satMainMenuItem[SAT_MENU_ITEM_COUNT_MAX]; /**< menu items */
+ unsigned short satMainMenuNum; /**< number of menu items */
+ int bIsSatMainMenuHelpInfo; /**< flag for help information request */
+ int bIsUpdatedSatMainMenu;
+ struct tel_sat_icon_identifier_info iconId; /**< con Identifier */
+ struct tel_sat_icon_identifier_list_info iconIdList; /**< List of Icon Identifiers */
+};
+
+/**
+ * @brief The structure type defining character data for the SAT engine data structure.
+ * @since_tizen 2.3
+ */
+struct tel_sat_text_info {
+ unsigned short stringLen; /**< Character data length */
+ unsigned char string[SAT_TEXT_STRING_LEN_MAX + 1]; /**< Character data */
+};
+
+/**
+ * @brief The structure type defining the display text proactive command for SAT UI.
+ * @since_tizen 2.3
+ */
+struct tel_sat_display_text_ind {
+ int commandId; /**< Proactive Command Number sent by USIM */
+ struct tel_sat_text_info text; /**< Character data to display on screen */
+ unsigned int duration; /**< The duration of the display */
+ int bIsPriorityHigh; /**< Flag that indicates whether text is to be displayed if some other app is using the screen */
+ int bIsUserRespRequired; /**< Flag that indicates whether user response is required */
+ int b_immediately_resp; /**< TBD */
+ struct tel_sat_icon_identifier_info iconId; /**< Icon Identifier */
+};
+
+/**
+ * @brief The structure type defining the menu item data object.
+ * @since_tizen 2.3
+ */
+struct tel_sat_menu_item_info {
+ unsigned char itemId; /**< Item identifier */
+ unsigned char textLen; /**< Text length */
+ unsigned char text[SAT_ITEM_TEXT_LEN_MAX + 1]; /**< Text information */
+};
+
+/**
+ * @brief The structure type defining select item proactive command data for SAT UI.
+ * @since_tizen 2.3
+ */
+struct tel_sat_select_item_ind {
+ int commandId; /**< Proactive Command Number sent by USIM */
+ int bIsHelpInfoAvailable; /**< Flag for a help information request */
+ struct tel_sat_text_info text; /**< Menu title text */
+ char defaultItemIndex; /**< Selected default item - default value is @c 0 */
+ char menuItemCount; /**< Number of menu items */
+ struct tel_sat_menu_item_info menuItem[SAT_MENU_ITEM_COUNT_MAX]; /**< Menu items */
+ struct tel_sat_icon_identifier_info iconId; /**< Icon Identifier */
+ struct tel_sat_icon_identifier_list_info iconIdList; /**< List of Icon Identifiers */
+};
+
+/**
+ * @brief The structure type defining get inkey proactive command data for SAT UI.
+ * @since_tizen 2.3
+ */
+struct tel_sat_get_inkey_ind {
+ int commandId; /**< Proactive Command Number sent by USIM */
+ enum inkey_type keyType; /**< Input Type: Character Set or Yes/No */
+ enum input_alphabet_type inputCharMode; /**< Input character mode(SMS default, UCS2) */
+ int bIsNumeric; /**< Is input character numeric(0-9, *, # and +) */
+ int bIsHelpInfoAvailable; /**< Help info request flag */
+ struct tel_sat_text_info text; /**< Character data to display on the screen */
+ unsigned int duration; /**< Duration of the display */
+ struct tel_sat_icon_identifier_info iconId; /**< Icon Identifier */
+};
+
+/**
+ * @brief The structure type defining get input proactive command data for SAT UI.
+ * @since_tizen 2.3
+ */
+struct tel_sat_get_input_ind {
+ int commandId; /**< Proactive Command Number sent by USIM */
+ enum input_alphabet_type inputCharMode; /**< Input character mode(SMS default, UCS2) */
+ int bIsNumeric; /**< Is input character numeric(0-9, *, # and +) */
+ int bIsHelpInfoAvailable; /**< Help info request flag */
+ int bIsEchoInput; /**< Flag that indicates whether to show input data on the screen */
+ struct tel_sat_text_info text; /**< Character data to display on the screen*/
+ struct tel_sat_response_length respLen; /**< Input data min, max length */
+ struct tel_sat_text_info defaultText; /**< Default input character data */
+ struct tel_sat_icon_identifier_info iconId; /**< Icon Identifier */
+};
+
+/**
+ * @brief The structure type defining refresh proactive command data for SAT UI.
+ * @since_tizen 2.3
+ */
+struct tel_sat_refresh_ind_ui_info {
+ int commandId; /**< Proactive Command Number sent by USIM */
+ unsigned int duration; /**< Duration of the display */
+ enum tel_sim_refresh_command refreshType; /**< Refresh mode */
+};
+
+/**
+ * @brief The structure type defining play tone proactive command data for an application.
+ * @since_tizen 2.3
+ */
+struct tel_sat_play_tone_ind {
+ int commandId; /**< Proactive Command Number sent by USIM */
+ struct tel_sat_text_info text; /**< Character data to display on the screen */
+ struct tel_sat_tone tone; /**< Tone info */
+ unsigned int duration; /**< Duration for playing the tone */
+ struct tel_sat_icon_identifier_info iconId; /**< Icon Identifier */
+};
+
+/**
+ * @brief The structure type defining the setup idle mode text proactive command for the idle application.
+ * @since_tizen 2.3
+ */
+struct tel_sat_setup_idle_mode_text_ind {
+ int commandId; /**< Proactive Command Number sent by USIM */
+ struct tel_sat_text_info text; /**< Character data to display on the screen */
+ struct tel_sat_icon_identifier_info iconId; /**< TBD */
+};
+
+/**
+ * @brief The structure type defining data for SAT UI.
+ * @since_tizen 2.3
+ */
+struct tel_sat_send_ui_info {
+ int commandId; /**< Proactive Command Number sent by USIM */
+ int user_confirm; /**< TBD */
+ struct tel_sat_text_info text; /**< Character data to display on the screen */
+ struct tel_sat_icon_identifier_info iconId; /**< Icon Identifier */
+};
+
+/**
+ * @brief The structure type defining send SS proactive command data for the SS application.
+ * @since_tizen 2.3
+ */
+struct tel_sat_send_ss_ind_ss_data {
+ int commandId; /**< Proactive Command Number sent by USIM */
+ enum tel_sim_ton ton; /**< Type of number */
+ enum tel_sim_npi npi; /**< Number plan identity */
+ unsigned short ssStringLen; /**< TBD */
+ unsigned char ssString[SAT_SS_STRING_LEN_MAX + 1]; /**< TBD */
+};
+
+/**
+ * @brief The structure type defining send USSD proactive command data for the USSD application.
+ * @since_tizen 2.3
+ */
+struct tel_sat_send_ussd_ind_ussd_data {
+ int commandId; /**< Proactive Command Number sent by USIM */
+ unsigned char rawDcs; /**< Data coding scheme */
+ unsigned short ussdStringLen; /**< TBD */
+ unsigned char ussdString[SAT_USSD_STRING_LEN_MAX + 1]; /**< TBD */
+};
+
gboolean sat_ui_support_terminate_sat_ui(void);
gboolean sat_ui_check_app_is_running(const char* app_id);
-gboolean sat_ui_support_launch_call_application(enum tel_sat_proactive_cmd_type cmd_type, GVariant *data, enum dbus_tapi_sim_slot_id slot_id);
-gboolean sat_ui_support_launch_browser_application(enum tel_sat_proactive_cmd_type cmd_type, GVariant *data, enum dbus_tapi_sim_slot_id slot_id);
-gboolean sat_ui_support_launch_ciss_application(enum tel_sat_proactive_cmd_type cmd_type, GVariant *data, enum dbus_tapi_sim_slot_id slot_id);
-gboolean sat_ui_support_launch_setting_application(enum tel_sat_proactive_cmd_type cmd_type, GVariant *data, enum dbus_tapi_sim_slot_id slot_id);
-gboolean sat_ui_support_launch_sat_ui(enum tel_sat_proactive_cmd_type cmd_type, GVariant *data, enum dbus_tapi_sim_slot_id slot_id);
-gboolean sat_ui_support_exec_bip(GDBusConnection *connection, const gchar *path, enum tel_sat_proactive_cmd_type cmd_type, GVariant *data);
-gboolean sat_ui_support_exec_evtdw(GDBusConnection *connection, const gchar *path, enum tel_sat_proactive_cmd_type cmd_type, GVariant *data);
+gboolean sat_ui_support_launch_browser_application(enum tel_sat_proactive_cmd_type cmd_type,
+ GVariant *data, enum dbus_tapi_sim_slot_id slot_id);
+gboolean sat_ui_support_launch_ciss_application(enum tel_sat_proactive_cmd_type cmd_type,
+ GVariant *data, enum dbus_tapi_sim_slot_id slot_id);
+gboolean sat_ui_support_launch_setting_application(enum tel_sat_proactive_cmd_type cmd_type,
+ GVariant *data, enum dbus_tapi_sim_slot_id slot_id);
+gboolean sat_ui_support_launch_sat_ui(enum tel_sat_proactive_cmd_type cmd_type,
+ GVariant *data, enum dbus_tapi_sim_slot_id slot_id);
+gboolean sat_ui_support_exec_bip(GDBusConnection *connection,
+ const gchar *path, enum tel_sat_proactive_cmd_type cmd_type, GVariant *data);
gboolean sat_ui_support_storage_init(Server *server);
+gboolean sat_ui_support_launch_eventdownloader_application(GVariant *data, enum dbus_tapi_sim_slot_id slot_id);
+
-#endif /* SAT_UI_SUPPORT_H_ */
+#endif /* __SAT_UI_SUPPORT_H__ */
+++ /dev/null
-/*
- * tel-plugin-dbus-tapi
- *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <glib.h>
-#include <gio/gio.h>
-
-#include <tcore.h>
-#include <server.h>
-#include <plugin.h>
-#include <hal.h>
-#include <communicator.h>
-#include <core_object.h>
-#include <queue.h>
-#include <user_request.h>
-#include <util.h>
-#include <co_sim.h>
-
-#include "generated-code.h"
-#include "common.h"
-
-#define DBUS_SIM_STATUS_ERROR "SIM STATUS ERROR"
-#define DBUS_SIM_NOT_FOUND "SIM NOT FOUND"
-#define DBUS_SIM_PERM_BLOCKED "SIM PERM BLOCKED"
-#define DBUS_SIM_CARD_ERROR "SIM CARD ERROR"
-#define DBUS_SIM_NOT_INITIALIZED "SIM NOT INITIALIZED"
-#define DBUS_SIM_INIT_COMPLETED "SIM INIT COMPLETED"
-#define DBUS_SIM_LOCKED "SIM LOCKED"
-#define DBUS_SIM_NOT_READY "SIM NOT READY"
-#define DBUS_SIM_RESPONSE_DATA_ERROR "SIM RESPONSE DATA ERROR"
-#define DBUS_SIM_SERVICE_IS_DISABLED "SIM SERVICE IS DISABLED"
-
-#define DBUS_SIM_GET_COSIM(invocation, co_sim, server) { \
- co_sim = __get_sim_co_by_cp_name(server, GET_CP_NAME(invocation)); \
- if (!co_sim) { \
- err("SIM Core object is NULL"); \
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED); \
- return TRUE; \
- } \
-}
-
-#define DBUS_SIM_CHECK_SIM_STATUS(op_type, co_sim) {\
- if (__check_sim_state(op_type, tcore_sim_get_status(co_sim)) == FALSE) { \
- err("Invalid SIM status"); \
- __return_fail_response(invocation, tcore_sim_get_status(co_sim)); \
- return TRUE; \
- } \
-}
-
-#define DBUS_SIM_CHECK_SIM_SERVICE_TABLE(op_type, co_sim) {\
- gboolean b_cphs = FALSE; \
- b_cphs = tcore_sim_get_cphs_status(co_sim); \
- if (b_cphs && op_type != GET_MSISDN) { \
- dbg("CPHS SIM... Do not check SST"); \
- } else { \
- struct tel_sim_service_table* svct = tcore_sim_get_service_table(co_sim); \
- if (svct != NULL) { \
- if (__check_sim_service_table(op_type, svct) == FALSE) { \
- err("'Service' is disabled in SST"); \
- FAIL_RESPONSE(invocation, DBUS_SIM_SERVICE_IS_DISABLED); \
- free(svct); \
- return TRUE; \
- } else { \
- dbg("Request to modem"); \
- free(svct); \
- } \
- } \
- } \
-}
-
-#define DBUS_SIM_CHECK_DISPATCH_RET(ret, invocation, ur) {\
- if (ret != TCORE_RETURN_SUCCESS) { \
- if (ret == TCORE_RETURN_SIM_DISABLED_IN_SST) { \
- err("'Service' is disabled in SST"); \
- FAIL_RESPONSE (invocation, DBUS_SIM_SERVICE_IS_DISABLED); \
- } else { \
- err("Dispatch request failed: [0x%x]", ret); \
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED); \
- } \
- tcore_user_request_unref(ur); \
- } \
-}
-
-enum dbus_tapi_sim_gdbus_method_name {
- GET_INIT_STATUS = 1,
- GET_CARD_TYPE,
- GET_IMSI,
- GET_ECC,
- GET_ICCID = 5,
- GET_LANGUAGE,
- SET_LANGUAGE,
- GET_CALL_FORWARDING,
- SET_CALL_FORWARDING,
- GET_MESSAGE_WAITING = 10,
- SET_MESSAGE_WAITING,
- GET_MAILBOX,
- SET_MAILBOX,
- GET_CPHS_INFO,
- GET_SVCT = 15,
- GET_MSISDN,
- GET_OPLMWACT,
- GET_SPN,
- GET_CPHS_NET_NAME,
- AUTHENTICATION = 20,
- VERIFY_SEC,
- VERIFY_PUK,
- CHANGE_PIN,
- DISABLE_FACILITY,
- ENABLE_FACILITY = 25,
- GET_FACILITY,
- GET_LOCK_INFO,
- TRANSFER_APDU,
- GET_ATR,
- GET_FIELDS = 30, //for get various data at once
- GET_GID,
- SET_POWERSTATE,
-
- //for notification
- STATUS = 100,
- REFRESHED,
-};
-
-#if 0
-static gboolean __is_valid_sim_status(enum tel_sim_status sim_status)
-{
- switch(sim_status) {
- case SIM_STATUS_INIT_COMPLETED:
- case SIM_STATUS_INITIALIZING:
- case SIM_STATUS_PIN_REQUIRED:
- case SIM_STATUS_PUK_REQUIRED:
- case SIM_STATUS_LOCK_REQUIRED:
- case SIM_STATUS_CARD_BLOCKED:
- case SIM_STATUS_NCK_REQUIRED:
- case SIM_STATUS_NSCK_REQUIRED:
- case SIM_STATUS_SPCK_REQUIRED:
- case SIM_STATUS_CCK_REQUIRED:
- return TRUE;
- default:
- return FALSE;
- }
-}
-#endif
-
-static CoreObject *__get_sim_co_by_cp_name(Server *server, char *cp_name)
-{
- TcorePlugin *plugin = NULL;
-
- if (!server) {
- err("server is NULL");
- return NULL;
- }
-
- plugin = tcore_server_find_plugin(server, cp_name);
- return tcore_plugin_ref_core_object(plugin, CORE_OBJECT_TYPE_SIM);
-}
-
-static CoreObject* __get_sim_co_from_ur(Server *server, UserRequest *ur)
-{
- CoreObject *co_sim = NULL;
- char *modem_name = NULL;
-
- modem_name = tcore_user_request_get_modem_name(ur);
- if (!modem_name) {
- err("Modem name is NULL");
- return co_sim;
- }
-
- co_sim = __get_sim_co_by_cp_name(server, modem_name);
- free(modem_name);
-
- return co_sim;
-}
-
-static gboolean __check_sim_state(enum dbus_tapi_sim_gdbus_method_name method, enum tel_sim_status sim_status)
-{
- gboolean ret = TRUE;
-
- if ((int)sim_status < SIM_STATUS_CARD_ERROR) {
- err("SIM status is NOT valid");
- return FALSE;
- }
-
- switch (method) {
- case GET_CARD_TYPE:
- case GET_ECC:
- case GET_ICCID:
- case GET_LANGUAGE:
- case GET_CPHS_INFO:
- case GET_SPN:
- case AUTHENTICATION:
- case TRANSFER_APDU:
- case GET_ATR:
- // Regarding Lock facilities
- case CHANGE_PIN:
- case ENABLE_FACILITY:
- case DISABLE_FACILITY:
- case GET_FACILITY:
- case GET_LOCK_INFO:
- case VERIFY_SEC:
- case VERIFY_PUK:
- if (sim_status == SIM_STATUS_CARD_ERROR
- || sim_status == SIM_STATUS_CARD_BLOCKED
- || sim_status == SIM_STATUS_CARD_NOT_PRESENT
- || sim_status == SIM_STATUS_CARD_REMOVED
- || sim_status == SIM_STATUS_UNKNOWN
- || sim_status == SIM_STATUS_CARD_POWEROFF) {
- ret = FALSE;
- }
- break;
- case GET_IMSI:
- case GET_SVCT:
- case GET_MSISDN:
- case GET_OPLMWACT:
- case GET_CPHS_NET_NAME:
- case GET_CALL_FORWARDING:
- case SET_CALL_FORWARDING:
- case GET_MESSAGE_WAITING:
- case SET_MESSAGE_WAITING:
- case GET_MAILBOX:
- case SET_MAILBOX:
- case SET_LANGUAGE:
- case GET_FIELDS:
- case GET_GID:
- if (sim_status != SIM_STATUS_INIT_COMPLETED) {
- ret = FALSE;
- }
- break;
- case SET_POWERSTATE:
- if (sim_status != SIM_STATUS_INIT_COMPLETED
- && sim_status != SIM_STATUS_INITIALIZING
- && sim_status != SIM_STATUS_PIN_REQUIRED
- && sim_status != SIM_STATUS_CARD_BLOCKED
- && sim_status != SIM_STATUS_CARD_POWEROFF) {
- ret = FALSE;
- }
- break;
- case GET_INIT_STATUS:
- case STATUS:
- case REFRESHED:
- default:
- err("Unhandled/Unknown operation: [%d]", method);
- break;
- }
- return ret;
-}
-
-static gboolean __check_sim_service_table(enum dbus_tapi_sim_gdbus_method_name method, struct tel_sim_service_table *svct)
-{
- gboolean ret = TRUE;
-
- switch (method) {
- case GET_MSISDN:
- if ( !(svct->sim_type == SIM_TYPE_GSM && svct->table.sst.service[SIM_SST_MSISDN]) &&
- !(svct->sim_type == SIM_TYPE_USIM && svct->table.ust.service[SIM_UST_MSISDN]) ) {
- ret = FALSE;
- }
- break;
- case GET_CALL_FORWARDING:
- case SET_CALL_FORWARDING:
- if ( !(svct->sim_type == SIM_TYPE_GSM && svct->table.sst.service[SIM_SST_CFIS]) &&
- !(svct->sim_type == SIM_TYPE_USIM && svct->table.ust.service[SIM_UST_CFIS]) ) {
- ret = FALSE;
- }
- break;
- case GET_MESSAGE_WAITING:
- case SET_MESSAGE_WAITING:
- if ( !(svct->sim_type == SIM_TYPE_GSM && svct->table.sst.service[SIM_SST_MWIS]) &&
- !(svct->sim_type == SIM_TYPE_USIM && svct->table.ust.service[SIM_UST_MWIS]) ) {
- ret = FALSE;
- }
- break;
- case GET_MAILBOX:
- case SET_MAILBOX:
- if ( !(svct->sim_type == SIM_TYPE_GSM && svct->table.sst.service[SIM_SST_MBDN]) &&
- !(svct->sim_type == SIM_TYPE_USIM && svct->table.ust.service[SIM_UST_MBDN]) ) {
- ret = FALSE;
- }
- break;
- default:
- err("Unhandled/Unknown operation: [%d]", method);
- break;
- }
-
- return ret;
-}
-
-static void __return_fail_response(GDBusMethodInvocation *invocation, enum tel_sim_status sim_status)
-{
- dbg("SIM Status: [%d]", sim_status);
-
- switch (sim_status) {
- case SIM_STATUS_CARD_NOT_PRESENT:
- case SIM_STATUS_CARD_REMOVED:
- FAIL_RESPONSE(invocation, DBUS_SIM_NOT_FOUND);
- break;
- case SIM_STATUS_CARD_BLOCKED:
- FAIL_RESPONSE(invocation, DBUS_SIM_PERM_BLOCKED);
- break;
- case SIM_STATUS_CARD_ERROR:
- case SIM_STATUS_CARD_CRASHED:
- FAIL_RESPONSE(invocation, DBUS_SIM_CARD_ERROR);
- break;
- case SIM_STATUS_INITIALIZING:
- FAIL_RESPONSE(invocation, DBUS_SIM_NOT_INITIALIZED);
- break;
- case SIM_STATUS_INIT_COMPLETED:
- FAIL_RESPONSE(invocation, DBUS_SIM_INIT_COMPLETED);
- break;
- case SIM_STATUS_PIN_REQUIRED:
- case SIM_STATUS_PUK_REQUIRED:
- case SIM_STATUS_NCK_REQUIRED:
- case SIM_STATUS_NSCK_REQUIRED:
- case SIM_STATUS_SPCK_REQUIRED:
- case SIM_STATUS_CCK_REQUIRED:
- case SIM_STATUS_LOCK_REQUIRED:
- FAIL_RESPONSE(invocation, DBUS_SIM_LOCKED);
- break;
- case SIM_STATUS_UNKNOWN:
- FAIL_RESPONSE(invocation, DBUS_SIM_NOT_READY);
- break;
- default:
- dbg("Unhandled/Unknown status: [%d]", sim_status);
- FAIL_RESPONSE(invocation, DBUS_SIM_STATUS_ERROR);
- break;
- }
-}
-
-static gboolean on_sim_get_init_status(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- enum tel_sim_status sim_status = SIM_STATUS_UNKNOWN;
- gboolean sim_changed = FALSE;
- CoreObject *co_sim = NULL;
-
- if (!check_access_control (invocation, AC_SIM, "r"))
- return TRUE;
-
- DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
-
- sim_status = tcore_sim_get_status(co_sim);
- sim_changed = tcore_sim_get_identification(co_sim);
- dbg("SIM - Status: [%d] Changed: [%s]",
- sim_status, (sim_changed ? "Yes" : "No"));
-
- telephony_sim_complete_get_init_status(sim, invocation, sim_status, sim_changed);
-
- return TRUE;
-}
-
-static gboolean on_sim_get_card_type(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- enum tel_sim_type sim_type = SIM_TYPE_UNKNOWN;
- CoreObject *co_sim = NULL;
-
- DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
- DBUS_SIM_CHECK_SIM_STATUS(GET_CARD_TYPE, co_sim);
-
- sim_type = tcore_sim_get_type(co_sim);
-
- telephony_sim_complete_get_card_type(sim, invocation, sim_type);
-
- return TRUE;
-}
-
-static gboolean on_sim_get_imsi(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- struct tel_sim_imsi *n_imsi;
- CoreObject *co_sim = NULL;
-
- if (!check_access_control (invocation, AC_SIM, "r"))
- return TRUE;
-
- DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
- DBUS_SIM_CHECK_SIM_STATUS(GET_IMSI, co_sim);
-
- n_imsi = tcore_sim_get_imsi(co_sim);
- if (!n_imsi) {
- FAIL_RESPONSE (invocation, DBUS_SIM_RESPONSE_DATA_ERROR);
- return TRUE;
- } else {
- telephony_sim_complete_get_imsi(sim, invocation, n_imsi->plmn, n_imsi->msin);
- free(n_imsi);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_get_ecc(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- CoreObject *co_sim = NULL;
- struct tel_sim_ecc_list *ecc_list = NULL;
-
- if (!check_access_control (invocation, AC_SIM, "r"))
- return TRUE;
-
- DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
- DBUS_SIM_CHECK_SIM_STATUS(GET_ECC, co_sim);
-
- ecc_list = tcore_sim_get_ecc_list(co_sim);
- if (!ecc_list) {
- UserRequest *ur = NULL;
- TReturn ret;
- dbg("po->ecc_list is NULL. Request to Modem.");
- ur = MAKE_UR(ctx, sim, invocation);
- tcore_user_request_set_command(ur, TREQ_SIM_GET_ECC);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
- } else {
- GVariant *gv = NULL;
- GVariantBuilder b;
- int i;
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- for (i = 0; i<ecc_list->ecc_count; i++) {
- dbg("ecc[%d] : ecc_category=[0x%x], ecc_num=[%s], ecc_string=[%s]",
- i, ecc_list->ecc[i].ecc_category, ecc_list->ecc[i].ecc_num, ecc_list->ecc[i].ecc_string);
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "category", g_variant_new_int32(ecc_list->ecc[i].ecc_category));
- g_variant_builder_add(&b, "{sv}", "number", g_variant_new_string(ecc_list->ecc[i].ecc_num));
- g_variant_builder_add(&b, "{sv}", "name", g_variant_new_string(ecc_list->ecc[i].ecc_string));
- g_variant_builder_close(&b);
- }
- gv = g_variant_builder_end(&b);
- if (!gv)
- dbg("error - ecc gv is NULL");
-
- telephony_sim_complete_get_ecc(sim, invocation, gv);
-
- free(ecc_list);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_get_iccid(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- CoreObject *co_sim = NULL;
- struct tel_sim_iccid* iccid = NULL;
-
- dbg("Func Entrance");
-
- if (!check_access_control (invocation, AC_SIM, "r"))
- return TRUE;
-
- DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
- DBUS_SIM_CHECK_SIM_STATUS(GET_ICCID, co_sim);
-
- iccid = tcore_sim_get_iccid(co_sim);
-
- if (!iccid) {
- ur = MAKE_UR(ctx, sim, invocation);
-
- tcore_user_request_set_command(ur, TREQ_SIM_GET_ICCID);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
- } else {
- telephony_sim_complete_get_iccid(sim, invocation, SIM_ACCESS_SUCCESS,
- iccid->iccid);
- free(iccid);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_get_language(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- CoreObject *co_sim = NULL;
-
- if (!check_access_control (invocation, AC_SIM, "r"))
- return TRUE;
-
- DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
- DBUS_SIM_CHECK_SIM_STATUS(GET_LANGUAGE, co_sim);
-
- ur = MAKE_UR(ctx, sim, invocation);
-
- tcore_user_request_set_command(ur, TREQ_SIM_GET_LANGUAGE);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_set_language(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gint arg_language, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- CoreObject *co_sim = NULL;
- struct treq_sim_set_language set_language;
-
- if (!check_access_control (invocation, AC_SIM, "w"))
- return TRUE;
-
- DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
- DBUS_SIM_CHECK_SIM_STATUS(SET_LANGUAGE, co_sim);
-
- memset(&set_language, 0, sizeof(struct treq_sim_set_language));
- set_language.language = arg_language;
-
- dbg("set_language.language[%d]", set_language.language);
- ur = MAKE_UR(ctx, sim, invocation);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_sim_set_language), &set_language);
- tcore_user_request_set_command(ur, TREQ_SIM_SET_LANGUAGE);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_get_call_forwarding(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- CoreObject *co_sim = NULL;
-
- if (!check_access_control (invocation, AC_SIM, "r"))
- return TRUE;
-
- DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
- DBUS_SIM_CHECK_SIM_STATUS(GET_CALL_FORWARDING, co_sim);
- DBUS_SIM_CHECK_SIM_SERVICE_TABLE(GET_CALL_FORWARDING, co_sim);
-
- ur = MAKE_UR(ctx, sim, invocation);
- tcore_user_request_set_command(ur, TREQ_SIM_GET_CALLFORWARDING);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- DBUS_SIM_CHECK_DISPATCH_RET(ret, invocation, ur);
-
- return TRUE;
-}
-
-static gboolean on_sim_set_call_forwarding(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gboolean arg_cphs,
- gint arg_rec_index,
- gint arg_msp_num,
- guchar arg_cfu_status,
- gint arg_ton,
- gint arg_npi,
- const gchar *arg_number,
- gint arg_cc2_id,
- gint arg_ext7_id,
- gboolean arg_cphs_line1,
- gboolean arg_cphs_line2,
- gboolean arg_cphs_fax,
- gboolean arg_cphs_data,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- CoreObject *co_sim = NULL;
- struct treq_sim_set_callforwarding req_cf;
-
- if (!check_access_control (invocation, AC_SIM, "w"))
- return TRUE;
-
- DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
- DBUS_SIM_CHECK_SIM_STATUS(SET_CALL_FORWARDING, co_sim);
- DBUS_SIM_CHECK_SIM_SERVICE_TABLE(SET_CALL_FORWARDING, co_sim);
-
- ur = MAKE_UR(ctx, sim, invocation);
-
- memset(&req_cf, 0, sizeof(struct treq_sim_set_callforwarding));
-
- req_cf.b_cphs = arg_cphs;
-
- if (req_cf.b_cphs) {
- req_cf.cphs_cf.b_line1 = arg_cphs_line1;
- req_cf.cphs_cf.b_line2 = arg_cphs_line2;
- req_cf.cphs_cf.b_fax = arg_cphs_fax;
- req_cf.cphs_cf.b_data = arg_cphs_data;
- dbg("b_line1[%d], b_line2[%d], b_fax[%d], b_data[%d]",
- req_cf.cphs_cf.b_line1, req_cf.cphs_cf.b_line2,
- req_cf.cphs_cf.b_fax, req_cf.cphs_cf.b_data);
- } else {
- req_cf.cf.rec_index = arg_rec_index;
- req_cf.cf.msp_num = arg_msp_num;
- req_cf.cf.cfu_status = arg_cfu_status;
- req_cf.cf.ton = arg_ton;
- req_cf.cf.npi = arg_npi;
- memcpy(&req_cf.cf.cfu_num, arg_number, strlen(arg_number));
- req_cf.cf.cc2_id = arg_cc2_id;
- req_cf.cf.ext7_id = arg_ext7_id;
- dbg("rec_index[%d], msp_num[%d], cfu_status[0x%x], ton[%d], "
- "npi[%d], cfu_num[%s], cc2_id[%d], ext7_id[%d]",
- req_cf.cf.rec_index, req_cf.cf.msp_num, req_cf.cf.cfu_status, req_cf.cf.ton,
- req_cf.cf.npi, req_cf.cf.cfu_num, req_cf.cf.cc2_id, req_cf.cf.ext7_id);
- }
-
- tcore_user_request_set_data(ur, sizeof(struct treq_sim_set_callforwarding), &req_cf);
- tcore_user_request_set_command(ur, TREQ_SIM_SET_CALLFORWARDING);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- DBUS_SIM_CHECK_DISPATCH_RET(ret, invocation, ur);
-
- return TRUE;
-}
-
-static gboolean on_sim_get_message_waiting(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- CoreObject *co_sim = NULL;
-
- if (!check_access_control (invocation, AC_SIM, "r"))
- return TRUE;
-
- DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
- DBUS_SIM_CHECK_SIM_STATUS(GET_MESSAGE_WAITING, co_sim);
- DBUS_SIM_CHECK_SIM_SERVICE_TABLE(GET_MESSAGE_WAITING, co_sim);
-
- ur = MAKE_UR(ctx, sim, invocation);
- tcore_user_request_set_command(ur, TREQ_SIM_GET_MESSAGEWAITING);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- DBUS_SIM_CHECK_DISPATCH_RET(ret, invocation, ur);
-
- return TRUE;
-}
-
-static gboolean on_sim_set_message_waiting(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gboolean arg_cphs,
- gint arg_rec_index,
- guchar arg_indicator_status,
- gint arg_voice_cnt,
- gint arg_fax_cnt,
- gint arg_email_cnt,
- gint arg_other_cnt,
- gint arg_video_cnt,
- gboolean arg_cphs_voice1,
- gboolean arg_cphs_voice2,
- gboolean arg_cphs_fax,
- gboolean arg_cphs_data,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- CoreObject *co_sim = NULL;
- struct treq_sim_set_messagewaiting req_mw;
-
- if (!check_access_control (invocation, AC_SIM, "w"))
- return TRUE;
-
- DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
- DBUS_SIM_CHECK_SIM_STATUS(SET_MESSAGE_WAITING, co_sim);
- DBUS_SIM_CHECK_SIM_SERVICE_TABLE(SET_MESSAGE_WAITING, co_sim);
-
- ur = MAKE_UR(ctx, sim, invocation);
-
- memset(&req_mw, 0, sizeof(struct treq_sim_set_messagewaiting));
-
- req_mw.b_cphs = arg_cphs;
-
- if (req_mw.b_cphs) {
- req_mw.cphs_mw.b_voice1 = arg_cphs_voice1;
- req_mw.cphs_mw.b_voice2 = arg_cphs_voice2;
- req_mw.cphs_mw.b_fax = arg_cphs_fax;
- req_mw.cphs_mw.b_data = arg_cphs_data;
- dbg("b_voice1[%d],b_voice2[%d],b_fax[%d], b_data[%d]",
- req_mw.cphs_mw.b_voice1,
- req_mw.cphs_mw.b_voice2,
- req_mw.cphs_mw.b_fax,
- req_mw.cphs_mw.b_data);
- } else {
- req_mw.mw.rec_index = arg_rec_index;
- req_mw.mw.indicator_status = arg_indicator_status;
- req_mw.mw.voice_count = arg_voice_cnt;
- req_mw.mw.fax_count = arg_fax_cnt;
- req_mw.mw.email_count = arg_email_cnt;
- req_mw.mw.other_count = arg_other_cnt;
- req_mw.mw.video_count = arg_video_cnt;
- dbg("rec_index[%d], indicator_status[0x%x], voice_count[%d], fax_count[%d], email_count[%d], other_count[%d], video_count[%d]",
- req_mw.mw.rec_index,
- req_mw.mw.indicator_status,
- req_mw.mw.voice_count,
- req_mw.mw.fax_count,
- req_mw.mw.email_count,
- req_mw.mw.other_count,
- req_mw.mw.video_count);
- }
-
- tcore_user_request_set_data(ur, sizeof(struct treq_sim_set_messagewaiting), &req_mw);
- tcore_user_request_set_command(ur, TREQ_SIM_SET_MESSAGEWAITING);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- DBUS_SIM_CHECK_DISPATCH_RET(ret, invocation, ur);
-
- return TRUE;
-}
-
-static gboolean on_sim_get_mailbox(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- CoreObject *co_sim = NULL;
-
- if (!check_access_control (invocation, AC_SIM, "r"))
- return TRUE;
-
- DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
- DBUS_SIM_CHECK_SIM_STATUS(GET_MAILBOX, co_sim);
- DBUS_SIM_CHECK_SIM_SERVICE_TABLE(GET_MAILBOX, co_sim);
-
- ur = MAKE_UR(ctx, sim, invocation);
- tcore_user_request_set_command(ur, TREQ_SIM_GET_MAILBOX);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- DBUS_SIM_CHECK_DISPATCH_RET(ret, invocation, ur);
-
- return TRUE;
-}
-
-static gboolean on_sim_set_mailbox(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gboolean arg_cphs,
- gint arg_type,
- gint arg_rec_index,
- gint arg_profile_number,
- gint arg_alpha_id_max_len,
- const gchar *arg_alpha_id,
- gint arg_ton,
- gint arg_npi,
- const gchar *arg_number,
- gint arg_cc_id,
- gint arg_ext1_id,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- CoreObject *co_sim = NULL;
- struct treq_sim_set_mailbox req_mb;
-
- if (!check_access_control (invocation, AC_SIM, "w"))
- return TRUE;
-
- DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
- DBUS_SIM_CHECK_SIM_STATUS(SET_MAILBOX, co_sim);
- DBUS_SIM_CHECK_SIM_SERVICE_TABLE(SET_MAILBOX, co_sim);
-
- ur = MAKE_UR(ctx, sim, invocation);
-
- memset(&req_mb, 0, sizeof(struct treq_sim_set_mailbox));
-
- req_mb.b_cphs = arg_cphs;
-
- req_mb.mb_info.mb_type = arg_type;
- req_mb.mb_info.rec_index = arg_rec_index;
- req_mb.mb_info.profile_number = arg_profile_number;
- req_mb.mb_info.number_info.alpha_id_max_len = arg_alpha_id_max_len;
- if (strlen(arg_alpha_id))
- memcpy(&req_mb.mb_info.number_info.alpha_id, arg_alpha_id, strlen(arg_alpha_id));
- req_mb.mb_info.number_info.ton = arg_npi;
- req_mb.mb_info.number_info.npi = arg_npi;
- if (strlen(arg_number))
- memcpy(&req_mb.mb_info.number_info.num, arg_number, strlen(arg_number));
- req_mb.mb_info.number_info.cc_id = arg_ext1_id;
- req_mb.mb_info.number_info.ext1_id = arg_ext1_id;
-
- dbg("b_cphs[%d] mb_type[%d], rec_index[%d], profile_number[%d], alpha_id_max_len[%d], "
- "alpha_id[%s], ton[%d], npi[%d], num[%s], cc_id[%d], ext1_id[%d]",
- req_mb.b_cphs,
- req_mb.mb_info.mb_type,
- req_mb.mb_info.rec_index,
- req_mb.mb_info.profile_number,
- req_mb.mb_info.number_info.alpha_id_max_len,
- req_mb.mb_info.number_info.alpha_id,
- req_mb.mb_info.number_info.ton,
- req_mb.mb_info.number_info.npi,
- req_mb.mb_info.number_info.num,
- req_mb.mb_info.number_info.cc_id,
- req_mb.mb_info.number_info.ext1_id)
-
- tcore_user_request_set_data(ur, sizeof(struct treq_sim_set_mailbox), &req_mb);
- tcore_user_request_set_command(ur, TREQ_SIM_SET_MAILBOX);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- DBUS_SIM_CHECK_DISPATCH_RET(ret, invocation, ur);
-
- return TRUE;
-}
-
-static gboolean on_sim_get_cphsinfo(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- CoreObject *co_sim = NULL;
-
- if (!check_access_control (invocation, AC_SIM, "r"))
- return TRUE;
-
- DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
- DBUS_SIM_CHECK_SIM_STATUS(GET_CPHS_INFO, co_sim);
-
- ur = MAKE_UR(ctx, sim, invocation);
-
- tcore_user_request_set_command(ur, TREQ_SIM_GET_CPHS_INFO);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_get_service_table(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- CoreObject *co_sim = NULL;
- struct tel_sim_service_table *svct = NULL;
-
- if (!check_access_control (invocation, AC_SIM, "r"))
- return TRUE;
-
- DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
- DBUS_SIM_CHECK_SIM_STATUS(GET_SVCT, co_sim);
-
- svct = tcore_sim_get_service_table(co_sim);
- if (!svct) {
- UserRequest *ur = NULL;
- TReturn ret;
- ur = MAKE_UR(ctx, sim, invocation);
-
- dbg("Not cached. Request to modem");
- tcore_user_request_set_command(ur, TREQ_SIM_GET_SERVICE_TABLE);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
- } else {
- GVariantBuilder builder;
- GVariant * inner_gv = NULL;
- GVariant *svct_gv = NULL;
- int i =0;
- dbg("TRESP_SIM_GET_SERVICE_TABLE");
-
- g_variant_builder_init (&builder, G_VARIANT_TYPE ("ay"));
- if (svct->sim_type == SIM_TYPE_GSM) {
- for (i = 0; i < SIM_SST_SERVICE_CNT_MAX; i++) {
- g_variant_builder_add (&builder, "y", svct->table.sst.service[i]);
- }
- } else if (svct->sim_type == SIM_TYPE_USIM) {
- for (i = 0; i < SIM_UST_SERVICE_CNT_MAX; i++) {
- g_variant_builder_add (&builder, "y", svct->table.ust.service[i]);
- }
- } else if(svct->sim_type == SIM_TYPE_RUIM) {
- if(SIM_CDMA_SVC_TABLE == svct->table.cst.cdma_svc_table) {
- for(i = 0; i < SIM_CDMA_ST_SERVICE_CNT_MAX; i++) {
- g_variant_builder_add (&builder, "iy", svct->table.cst.cdma_svc_table,
- svct->table.cst.service.cdma_service[i]);
- }
- } else if(SIM_CSIM_SVC_TABLE == svct->table.cst.cdma_svc_table) {
- for(i = 0; i < SIM_CSIM_ST_SERVICE_CNT_MAX; i++) {
- g_variant_builder_add (&builder, "iy", svct->table.cst.cdma_svc_table,
- svct->table.cst.service.csim_service[i]);
- }
- } else {
- err("Invalid cdma_svc_table:[%d]", svct->table.cst.cdma_svc_table);
- }
- } else {
- err("Unknown SIM type: [%d]", svct->sim_type);
- }
- inner_gv = g_variant_builder_end(&builder);
- svct_gv = g_variant_new("v", inner_gv);
-
- telephony_sim_complete_get_service_table (sim, invocation,
- SIM_ACCESS_SUCCESS,
- svct->sim_type,
- svct_gv);
-
- free(svct);
- }
- return TRUE;
-}
-
-static gboolean on_sim_get_msisdn(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- TReturn ret;
- CoreObject *co_sim = NULL;
- struct tel_sim_msisdn_list *msisdn_list = NULL;
- gboolean read_from_modem = FALSE;
-
- if (!check_access_control (invocation, AC_SIM, "r"))
- return TRUE;
-
- DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
- DBUS_SIM_CHECK_SIM_STATUS(GET_MSISDN, co_sim);
- DBUS_SIM_CHECK_SIM_SERVICE_TABLE(GET_MSISDN, co_sim);
-
- if(SIM_TYPE_NVSIM == tcore_sim_get_type(co_sim)) {
- dbg("In NV SIM, don't use MSISDN cached");
- read_from_modem = TRUE;
- } else {
- msisdn_list = tcore_sim_get_msisdn_list(co_sim);
- if (msisdn_list)
- read_from_modem = FALSE;
- else
- read_from_modem = TRUE;
- }
-
- if(read_from_modem) {
- UserRequest *ur = NULL;
-
- ur = MAKE_UR(ctx, sim, invocation);
- dbg("Not cached. Request to modem");
- tcore_user_request_set_command(ur, TREQ_SIM_GET_MSISDN);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- DBUS_SIM_CHECK_DISPATCH_RET(ret, invocation, ur);
- } else {
- GVariant *gv = NULL;
- int i;
- GVariantBuilder b;
- dbg("TRESP_SIM_GET_MSISDN");
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- dbg("msisdn_list->count = %d", msisdn_list->count);
- for (i = 0;i < msisdn_list->count; i++) {
- g_variant_builder_open(&b,G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "name", g_variant_new_string((const gchar *)msisdn_list->msisdn[i].name));
- if (msisdn_list->msisdn[i].ton == SIM_TON_INTERNATIONAL) {
- unsigned char *tmp = (unsigned char *)calloc(SIM_MSISDN_NUMBER_LEN_MAX + 1, 1);
- if (tmp!=NULL) {
- tmp[0] = '+';
- strncpy((char *)tmp+1, (const char*)msisdn_list->msisdn[i].num, SIM_MSISDN_NUMBER_LEN_MAX - 1);
- tmp[SIM_MSISDN_NUMBER_LEN_MAX] = '\0';
- g_variant_builder_add(&b, "{sv}", "number", g_variant_new_string((const gchar *)tmp));
- free(tmp);
- } else {
- dbg("calloc failed.");
- g_variant_builder_add(&b, "{sv}", "number", g_variant_new_string((const gchar *)msisdn_list->msisdn[i].num));
- }
- } else {
- g_variant_builder_add(&b, "{sv}", "number", g_variant_new_string((const gchar *)msisdn_list->msisdn[i].num));
- }
- g_variant_builder_close(&b);
- }
- gv = g_variant_builder_end(&b);
-
- telephony_sim_complete_get_msisdn (sim, invocation, SIM_ACCESS_SUCCESS, gv);
- free(msisdn_list);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_get_oplmnwact(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- CoreObject *co_sim = NULL;
-
- if (!check_access_control (invocation, AC_SIM, "r"))
- return TRUE;
-
- DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
- DBUS_SIM_CHECK_SIM_STATUS(GET_OPLMWACT, co_sim);
-
- ur = MAKE_UR(ctx, sim, invocation);
-
- tcore_user_request_set_command(ur, TREQ_SIM_GET_OPLMNWACT);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_get_spn(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- CoreObject *co_sim = NULL;
- struct tel_sim_spn* spn = NULL;
-
- if (!check_access_control (invocation, AC_SIM, "r"))
- return TRUE;
-
- DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
- DBUS_SIM_CHECK_SIM_STATUS(GET_SPN, co_sim);
-
- spn = tcore_sim_get_spn(co_sim);
-
- if (!spn) {
- ur = MAKE_UR(ctx, sim, invocation);
-
- tcore_user_request_set_command(ur, TREQ_SIM_GET_SPN);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
-
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
- } else {
- telephony_sim_complete_get_spn (sim, invocation, SIM_ACCESS_SUCCESS,
- spn->display_condition, (const gchar *)spn->spn);
- free(spn);
- }
- return TRUE;
-}
-
-static gboolean on_sim_get_cphs_netname(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- CoreObject *co_sim = NULL;
- struct tel_sim_cphs_netname *cphs_netname = NULL;
-
- if (!check_access_control (invocation, AC_SIM, "r"))
- return TRUE;
-
- DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
- DBUS_SIM_CHECK_SIM_STATUS(GET_CPHS_NET_NAME, co_sim);
-
- cphs_netname = tcore_sim_get_cphs_netname(co_sim);
-
- if (!cphs_netname) {
- ur = MAKE_UR(ctx, sim, invocation);
-
- tcore_user_request_set_command(ur, TREQ_SIM_GET_CPHS_NETNAME);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
- } else {
- telephony_sim_complete_get_cphs_net_name (sim, invocation, SIM_ACCESS_SUCCESS,
- (const gchar *)cphs_netname->full_name,
- (const gchar *)cphs_netname->short_name);
- free(cphs_netname);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_get_gid(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- CoreObject *co_sim = NULL;
-
- if (!check_access_control (invocation, AC_SIM, "r"))
- return TRUE;
-
- DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
- DBUS_SIM_CHECK_SIM_STATUS(GET_GID, co_sim);
-
- ur = MAKE_UR(ctx, sim, invocation);
-
- tcore_user_request_set_command(ur, TREQ_SIM_GET_GID);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_authentication(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gint arg_type,
- GVariant *arg_rand,
- GVariant *arg_autn,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- GVariantIter *iter = NULL;
- GVariant *rand_gv = NULL;
- GVariant *autn_gv = NULL;
- guchar rt_i;
- int i =0;
- TReturn ret;
- CoreObject *co_sim = NULL;
- struct treq_sim_req_authentication req_auth;
-
- if (!check_access_control (invocation, AC_SIM, "x"))
- return TRUE;
-
- DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
- DBUS_SIM_CHECK_SIM_STATUS(AUTHENTICATION, co_sim);
-
- memset(&req_auth, 0, sizeof(struct treq_sim_req_authentication));
-
- req_auth.auth_type = arg_type;
-
- rand_gv = g_variant_get_variant(arg_rand);
- g_variant_get(rand_gv, "ay", &iter);
- while ( g_variant_iter_loop (iter, "y", &rt_i)) {
- req_auth.rand_data[i] = rt_i;
- i++;
- }
- req_auth.rand_length = (unsigned int)i;
-
- i = 0;
- autn_gv = g_variant_get_variant(arg_autn);
- g_variant_get(autn_gv, "ay", &iter);
- while ( g_variant_iter_loop (iter, "y", &rt_i)) {
- req_auth.autn_data[i] = rt_i;
- i++;
- }
- req_auth.autn_length = (unsigned int)i;
-
- ur = MAKE_UR(ctx, sim, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sim_req_authentication), &req_auth);
- tcore_user_request_set_command(ur, TREQ_SIM_REQ_AUTHENTICATION);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- GVariantBuilder builder;
- GVariant *ak = NULL;
- GVariant *cp = NULL;
- GVariant *it = NULL;
- GVariant *resp = NULL;
- GVariant *ak_gv = NULL;
- GVariant *cp_gv = NULL;
- GVariant *it_gv = NULL;
- GVariant *resp_gv = NULL;
-
- g_variant_builder_init (&builder, G_VARIANT_TYPE ("ay"));
- ak = g_variant_builder_end(&builder);
- ak_gv = g_variant_new("v", ak);
-
- g_variant_builder_init (&builder, G_VARIANT_TYPE ("ay"));
- cp = g_variant_builder_end(&builder);
- cp_gv = g_variant_new("v", cp);
-
- g_variant_builder_init (&builder, G_VARIANT_TYPE ("ay"));
- it = g_variant_builder_end(&builder);
- it_gv = g_variant_new("v", it);
-
- g_variant_builder_init (&builder, G_VARIANT_TYPE ("ay"));
- resp = g_variant_builder_end(&builder);
- resp_gv = g_variant_new("v", resp);
-
- telephony_sim_complete_authentication (sim, invocation, SIM_ACCESS_FAILED, 0, 0, ak_gv, cp_gv, it_gv, resp_gv);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_verify_sec(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gint arg_type,
- const gchar *arg_password,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- CoreObject *co_sim = NULL;
- struct treq_sim_verify_pins verify_pins;
-
- if (!check_access_control (invocation, AC_SIM, "x"))
- return TRUE;
-
- DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
- DBUS_SIM_CHECK_SIM_STATUS(VERIFY_SEC, co_sim);
-
- memset(&verify_pins, 0, sizeof(struct treq_sim_verify_pins));
-
- verify_pins.pin_type = arg_type;
- verify_pins.pin_length = strlen(arg_password);
- memcpy(verify_pins.pin, arg_password, verify_pins.pin_length);
-
- ur = MAKE_UR(ctx, sim, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sim_verify_pins), &verify_pins);
- tcore_user_request_set_command(ur, TREQ_SIM_VERIFY_PINS);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_verify_puk(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gint arg_type,
- const gchar *arg_puk,
- const gchar *arg_new_pin,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- CoreObject *co_sim = NULL;
- struct treq_sim_verify_puks verify_puks;
-
- if (!check_access_control (invocation, AC_SIM, "x"))
- return TRUE;
-
- DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
- DBUS_SIM_CHECK_SIM_STATUS(VERIFY_PUK, co_sim);
-
- memset(&verify_puks, 0, sizeof(struct treq_sim_verify_puks));
-
- verify_puks.puk_type = arg_type;
- verify_puks.puk_length = strlen(arg_puk);
- memcpy(verify_puks.puk, arg_puk, verify_puks.puk_length);
- verify_puks.pin_length = strlen(arg_new_pin);
- memcpy(verify_puks.pin, arg_new_pin, verify_puks.pin_length);
-
- ur = MAKE_UR(ctx, sim, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sim_verify_puks), &verify_puks);
- tcore_user_request_set_command(ur, TREQ_SIM_VERIFY_PUKS);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_change_pin(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gint arg_type,
- const gchar *arg_old_password,
- const gchar *arg_new_password,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- CoreObject *co_sim = NULL;
- struct treq_sim_change_pins change_pins;
-
- if (!check_access_control (invocation, AC_SIM, "x"))
- return TRUE;
-
- DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
- DBUS_SIM_CHECK_SIM_STATUS(CHANGE_PIN, co_sim);
-
- memset(&change_pins, 0, sizeof(struct treq_sim_change_pins));
-
- change_pins.type = arg_type;
- change_pins.old_pin_length = strlen(arg_old_password);
- memcpy(change_pins.old_pin, arg_old_password, change_pins.old_pin_length);
- change_pins.new_pin_length = strlen(arg_new_password);
- memcpy(change_pins.new_pin, arg_new_password, change_pins.new_pin_length);
-
- ur = MAKE_UR(ctx, sim, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sim_change_pins), &change_pins);
- tcore_user_request_set_command(ur, TREQ_SIM_CHANGE_PINS);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_disable_facility(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gint arg_type,
- const gchar *arg_password,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- struct treq_sim_disable_facility dis_facility;
- CoreObject *co_sim = NULL;
-
- if (!check_access_control (invocation, AC_SIM, "x"))
- return TRUE;
-
- DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
- DBUS_SIM_CHECK_SIM_STATUS(DISABLE_FACILITY, co_sim);
-
- memset(&dis_facility, 0, sizeof(struct treq_sim_disable_facility));
-
- dbg("arg_type[%d]", arg_type);
- switch (arg_type) {
- case 1:
- dis_facility.type = SIM_FACILITY_PS;
- break;
- case 3:
- dis_facility.type = SIM_FACILITY_SC;
- break;
- case 4:
- dis_facility.type = SIM_FACILITY_FD;
- break;
- case 5:
- dis_facility.type = SIM_FACILITY_PN;
- break;
- case 6:
- dis_facility.type = SIM_FACILITY_PU;
- break;
- case 7:
- dis_facility.type = SIM_FACILITY_PP;
- break;
- case 8:
- dis_facility.type = SIM_FACILITY_PC;
- break;
- default:
- err("Unhandled/Unknown type[0x%x]", arg_type);
- break;
- }
- dis_facility.password_length = strlen(arg_password);
- memcpy(dis_facility.password, arg_password, dis_facility.password_length);
-
- ur = MAKE_UR(ctx, sim, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sim_disable_facility), &dis_facility);
- tcore_user_request_set_command(ur, TREQ_SIM_DISABLE_FACILITY);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_enable_facility(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gint arg_type,
- const gchar *arg_password,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- struct treq_sim_enable_facility en_facility;
- CoreObject *co_sim = NULL;
-
- if (!check_access_control (invocation, AC_SIM, "x"))
- return TRUE;
-
- DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
- DBUS_SIM_CHECK_SIM_STATUS(ENABLE_FACILITY, co_sim);
-
- memset(&en_facility, 0, sizeof(struct treq_sim_enable_facility));
-
- dbg("arg_type[%d]", arg_type);
- switch (arg_type) {
- case 1:
- en_facility.type = SIM_FACILITY_PS;
- break;
- case 3:
- en_facility.type = SIM_FACILITY_SC;
- break;
- case 4:
- en_facility.type = SIM_FACILITY_FD;
- break;
- case 5:
- en_facility.type = SIM_FACILITY_PN;
- break;
- case 6:
- en_facility.type = SIM_FACILITY_PU;
- break;
- case 7:
- en_facility.type = SIM_FACILITY_PP;
- break;
- case 8:
- en_facility.type = SIM_FACILITY_PC;
- break;
- default:
- err("Unhandled/Unknown type[0x%x]", arg_type);
- break;
- }
- en_facility.password_length = strlen(arg_password);
- memcpy(en_facility.password, arg_password, en_facility.password_length);
-
- ur = MAKE_UR(ctx, sim, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sim_enable_facility), &en_facility);
- tcore_user_request_set_command(ur, TREQ_SIM_ENABLE_FACILITY);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_get_facility(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gint arg_type,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- struct treq_sim_get_facility_status facility;
- CoreObject *co_sim = NULL;
-
- if (!check_access_control (invocation, AC_SIM, "r"))
- return TRUE;
-
- DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
- DBUS_SIM_CHECK_SIM_STATUS(GET_FACILITY, co_sim);
-
- memset(&facility, 0, sizeof(struct treq_sim_get_facility_status));
-
- dbg("arg_type[%d]", arg_type);
-
- switch (arg_type) {
- case 1:
- facility.type = SIM_FACILITY_PS;
- break;
- case 3:
- facility.type = SIM_FACILITY_SC;
- break;
- case 4:
- facility.type = SIM_FACILITY_FD;
- break;
- case 5:
- facility.type = SIM_FACILITY_PN;
- break;
- case 6:
- facility.type = SIM_FACILITY_PU;
- break;
- case 7:
- facility.type = SIM_FACILITY_PP;
- break;
- case 8:
- facility.type = SIM_FACILITY_PC;
- break;
- default:
- err("Unhandled/Unknown type[0x%x]", arg_type);
- break;
- }
-
- ur = MAKE_UR(ctx, sim, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sim_get_facility_status), &facility);
- tcore_user_request_set_command(ur, TREQ_SIM_GET_FACILITY_STATUS);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_get_lock_info(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gint arg_type,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- CoreObject *co_sim = NULL;
- struct treq_sim_get_lock_info lock_info;
-
- if (!check_access_control (invocation, AC_SIM, "r"))
- return TRUE;
-
- DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
- DBUS_SIM_CHECK_SIM_STATUS(GET_LOCK_INFO, co_sim);
-
- memset(&lock_info, 0, sizeof(struct treq_sim_get_lock_info));
-
- dbg("arg_type[%d]", arg_type);
- switch (arg_type) {
- case 1:
- lock_info.type = SIM_FACILITY_PS;
- break;
- case 3:
- lock_info.type = SIM_FACILITY_SC;
- break;
- case 4:
- lock_info.type = SIM_FACILITY_FD;
- break;
- case 5:
- lock_info.type = SIM_FACILITY_PN;
- break;
- case 6:
- lock_info.type = SIM_FACILITY_PU;
- break;
- case 7:
- lock_info.type = SIM_FACILITY_PP;
- break;
- case 8:
- lock_info.type = SIM_FACILITY_PC;
- break;
- default:
- err("Unhandled/Unknown type[0x%x]", arg_type);
- break;
- }
-
- ur = MAKE_UR(ctx, sim, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sim_get_lock_info), &lock_info);
- tcore_user_request_set_command(ur, TREQ_SIM_GET_LOCK_INFO);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_transfer_apdu(TelephonySim *sim, GDBusMethodInvocation *invocation,
- GVariant *arg_apdu,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- struct treq_sim_transmit_apdu send_apdu;
- GVariantIter *iter = NULL;
- GVariant *inner_gv = NULL;
- guchar rt_i;
- TReturn ret;
- CoreObject *co_sim = NULL;
- int i =0;
-
- if (!check_access_control (invocation, AC_SIM, "x"))
- return TRUE;
-
- DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
- DBUS_SIM_CHECK_SIM_STATUS(TRANSFER_APDU, co_sim);
-
- memset(&send_apdu, 0, sizeof(struct treq_sim_transmit_apdu));
-
- inner_gv = g_variant_get_variant(arg_apdu);
-
- g_variant_get(inner_gv, "ay", &iter);
- while ( g_variant_iter_loop (iter, "y", &rt_i)) {
- send_apdu.apdu[i] = rt_i;
- i++;
- }
- send_apdu.apdu_length = (unsigned int)i;
- g_variant_iter_free(iter);
- g_variant_unref(inner_gv);
- g_variant_unref(arg_apdu);
-
- tcore_util_hex_dump("[APDU_REQ] ", send_apdu.apdu_length, send_apdu.apdu);
-
- ur = MAKE_UR(ctx, sim, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sim_transmit_apdu), &send_apdu);
- tcore_user_request_set_command(ur, TREQ_SIM_TRANSMIT_APDU);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_get_atr(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- CoreObject *co_sim = NULL;
-
- if (!check_access_control (invocation, AC_SIM, "r"))
- return TRUE;
-
- DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
- DBUS_SIM_CHECK_SIM_STATUS(GET_ATR, co_sim);
-
- ur = MAKE_UR(ctx, sim, invocation);
-
- tcore_user_request_set_command(ur, TREQ_SIM_GET_ATR);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_get_fields(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- struct tel_sim_imsi *n_imsi = NULL;
- //struct tel_sim_msisdn_list *msisdn_list = NULL;
- //struct tel_sim_iccid *iccid = NULL;
- //struct tel_sim_spn *spn= NULL;
- CoreObject *co_sim = NULL;
- GVariantBuilder b;
- GVariant *gv_fields = NULL;
-
- dbg("Func Entrance");
-
- if (!check_access_control (invocation, AC_SIM, "r"))
- return TRUE;
-
- DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("a{svv}}"));
-
- DBUS_SIM_CHECK_SIM_STATUS(GET_IMSI, co_sim);
-
- n_imsi = tcore_sim_get_imsi(co_sim);
- if (n_imsi != NULL) {
- g_variant_builder_add(&b, "{svv}", "imsi", g_variant_new_string("plmn"), g_variant_new_string(n_imsi->plmn));
- g_variant_builder_add(&b, "{svv}", "imsi", g_variant_new_string("msin"), g_variant_new_string(n_imsi->msin));
- free(n_imsi);
- }
-
- DBUS_SIM_CHECK_SIM_STATUS(GET_ICCID, co_sim);
- //n_imsi = tcore_sim_get_imsi(co_sim);
- //if (n_imsi != NULL) {
- g_variant_builder_add(&b, "{svv}", "iccid", g_variant_new_string(""), g_variant_new_string(""));
- //free(n_imsi);
- //}
-
- DBUS_SIM_CHECK_SIM_STATUS(GET_MSISDN, co_sim);
- g_variant_builder_add(&b, "{svv}", "msisdn", g_variant_new_string("name"), g_variant_new_string("number"));
-
- DBUS_SIM_CHECK_SIM_STATUS(GET_SPN, co_sim);
- g_variant_builder_add(&b, "{svv}", "spn", g_variant_new_uint16(255), g_variant_new_string("network name"));
-
- DBUS_SIM_CHECK_SIM_STATUS(GET_INIT_STATUS, co_sim);
- g_variant_builder_add(&b, "{svv}", "init_status", g_variant_new_uint16(0), g_variant_new_boolean(TRUE));
-
- gv_fields = g_variant_builder_end(&b);
-
- telephony_sim_complete_get_fields(sim, invocation, 0, gv_fields);
-
- return TRUE;
-}
-
-static gboolean on_sim_set_power_state(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gint arg_state, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- CoreObject *co_sim = NULL;
- struct treq_sim_set_powerstate set_powerstate;
-
- if (!check_access_control (invocation, AC_SIM, "w"))
- return TRUE;
-
- DBUS_SIM_GET_COSIM(invocation, co_sim, ctx->server);
- DBUS_SIM_CHECK_SIM_STATUS(SET_POWERSTATE, co_sim);
-
- memset(&set_powerstate, 0, sizeof(struct treq_sim_set_powerstate));
- set_powerstate.state = arg_state;
-
- dbg("set_powerstate.state[%d]", set_powerstate.state);
- ur = MAKE_UR(ctx, sim, invocation);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_sim_set_powerstate), &set_powerstate);
- tcore_user_request_set_command(ur, TREQ_SIM_SET_POWERSTATE);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-gboolean dbus_plugin_setup_sim_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx)
-{
- TelephonySim *sim;
-
- sim = telephony_sim_skeleton_new();
- telephony_object_skeleton_set_sim(object, sim);
- g_object_unref(sim);
-
- dbg("sim: [%p]", sim);
-
- telephony_sim_set_cf_state(sim, FALSE);
-
- g_signal_connect (sim,
- "handle-get-init-status",
- G_CALLBACK (on_sim_get_init_status),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-card-type",
- G_CALLBACK (on_sim_get_card_type),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-imsi",
- G_CALLBACK (on_sim_get_imsi),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-ecc",
- G_CALLBACK (on_sim_get_ecc),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-iccid",
- G_CALLBACK (on_sim_get_iccid),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-language",
- G_CALLBACK (on_sim_get_language),
- ctx);
-
- g_signal_connect (sim,
- "handle-set-language",
- G_CALLBACK (on_sim_set_language),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-call-forwarding",
- G_CALLBACK (on_sim_get_call_forwarding),
- ctx);
-
- g_signal_connect (sim,
- "handle-set-call-forwarding",
- G_CALLBACK (on_sim_set_call_forwarding),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-message-waiting",
- G_CALLBACK (on_sim_get_message_waiting),
- ctx);
-
- g_signal_connect (sim,
- "handle-set-message-waiting",
- G_CALLBACK (on_sim_set_message_waiting),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-mailbox",
- G_CALLBACK (on_sim_get_mailbox),
- ctx);
-
- g_signal_connect (sim,
- "handle-set-mailbox",
- G_CALLBACK (on_sim_set_mailbox),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-cphsinfo",
- G_CALLBACK (on_sim_get_cphsinfo),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-service-table",
- G_CALLBACK (on_sim_get_service_table),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-msisdn",
- G_CALLBACK (on_sim_get_msisdn),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-oplmnwact",
- G_CALLBACK (on_sim_get_oplmnwact),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-spn",
- G_CALLBACK (on_sim_get_spn),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-cphs-net-name",
- G_CALLBACK (on_sim_get_cphs_netname),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-gid",
- G_CALLBACK (on_sim_get_gid),
- ctx);
-
- g_signal_connect (sim,
- "handle-authentication",
- G_CALLBACK (on_sim_authentication),
- ctx);
-
- g_signal_connect (sim,
- "handle-verify-sec",
- G_CALLBACK (on_sim_verify_sec),
- ctx);
-
- g_signal_connect (sim,
- "handle-verify-puk",
- G_CALLBACK (on_sim_verify_puk),
- ctx);
-
- g_signal_connect (sim,
- "handle-change-pin",
- G_CALLBACK (on_sim_change_pin),
- ctx);
-
- g_signal_connect (sim,
- "handle-disable-facility",
- G_CALLBACK (on_sim_disable_facility),
- ctx);
-
- g_signal_connect (sim,
- "handle-enable-facility",
- G_CALLBACK (on_sim_enable_facility),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-facility",
- G_CALLBACK (on_sim_get_facility),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-lock-info",
- G_CALLBACK (on_sim_get_lock_info),
- ctx);
-
- g_signal_connect (sim,
- "handle-transfer-apdu",
- G_CALLBACK (on_sim_transfer_apdu),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-atr",
- G_CALLBACK (on_sim_get_atr),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-fields",
- G_CALLBACK (on_sim_get_fields),
- ctx);
-
- g_signal_connect (sim,
- "handle-set-powerstate",
- G_CALLBACK (on_sim_set_power_state),
- ctx);
-
- return TRUE;
-}
-
-gboolean dbus_plugin_sim_response(struct custom_data *ctx, UserRequest *ur,
- struct dbus_request_info *dbus_info, enum tcore_response_command command,
- unsigned int data_len, const void *data)
-{
- dbg("Response!!! Command: [0x%x] CP Name: [%s]",
- command, GET_CP_NAME(dbus_info->invocation));
-
- switch (command) {
- case TRESP_SIM_GET_ECC: {
- const struct tresp_sim_read *resp_read = data;
- CoreObject *co_sim = NULL;
- GVariant *gv = NULL;
- GVariantBuilder b;
- int i = 0;
-
- dbg("TRESP_SIM_GET_ECC - Result: [%s])",
- (resp_read->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"));
-
- co_sim = __get_sim_co_from_ur(ctx->server, ur);
- if (!co_sim) {
- err("SIM Core object is NULL");
- return FALSE;
- }
-
- if (resp_read->result == SIM_ACCESS_SUCCESS) {
- tcore_sim_set_ecc_list(co_sim, &resp_read->data.ecc);
- } else if (resp_read->result == SIM_ACCESS_FILE_NOT_FOUND) {
- tcore_sim_set_ecc_list(co_sim, NULL);
- }
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- for (i = 0; i < resp_read->data.ecc.ecc_count; i++) {
- dbg("ecc[%d] : ecc_category=[0x%x], ecc_num=[%s], ecc_string=[%s]", i,
- resp_read->data.ecc.ecc[i].ecc_category,
- resp_read->data.ecc.ecc[i].ecc_num,
- resp_read->data.ecc.ecc[i].ecc_string);
-
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "category", g_variant_new_int32(resp_read->data.ecc.ecc[i].ecc_category));
- g_variant_builder_add(&b, "{sv}", "number", g_variant_new_string(resp_read->data.ecc.ecc[i].ecc_num));
- g_variant_builder_add(&b, "{sv}", "name", g_variant_new_string(resp_read->data.ecc.ecc[i].ecc_string));
- g_variant_builder_close(&b);
- }
- gv = g_variant_builder_end(&b);
-
- telephony_sim_complete_get_ecc (dbus_info->interface_object, dbus_info->invocation, gv);
- }
- break;
-
- case TRESP_SIM_GET_ICCID: {
- const struct tresp_sim_read *resp_read = data;
- CoreObject *co_sim = NULL;
-
- dbg("TRESP_SIM_GET_ICCID - Result: [%s] ICCID: [%s])",
- (resp_read->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"),
- resp_read->data.iccid.iccid);
-
- co_sim = __get_sim_co_from_ur(ctx->server, ur);
- if (!co_sim) {
- err("SIM Core object is NULL");
- return FALSE;
- }
-
- if (resp_read->result == SIM_ACCESS_SUCCESS) {
- tcore_sim_set_iccid(co_sim, &resp_read->data.iccid);
- } else if (resp_read->result == SIM_ACCESS_FILE_NOT_FOUND) {
- tcore_sim_set_iccid(co_sim, NULL);
- }
-
- telephony_sim_complete_get_iccid(dbus_info->interface_object, dbus_info->invocation,
- resp_read->result,
- resp_read->data.iccid.iccid);
- }
- break;
-
- case TRESP_SIM_GET_LANGUAGE: {
- const struct tresp_sim_read *resp_read = data;
-
- dbg("TRESP_SIM_GET_LANGUAGE - Result: [%s] Language: [0x%2x]",
- (resp_read->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"),
- resp_read->data.language.language[0]);
-
- telephony_sim_complete_get_language(dbus_info->interface_object, dbus_info->invocation,
- resp_read->result,
- resp_read->data.language.language[0]);
- }
- break;
-
- case TRESP_SIM_SET_LANGUAGE: {
- const struct tresp_sim_set_data *resp_set_data = data;
-
- dbg("TRESP_SIM_SET_LANGUAGE - Result: [%s]",
- (resp_set_data->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"));
-
- telephony_sim_complete_set_language(dbus_info->interface_object, dbus_info->invocation,
- resp_set_data->result);
- }
- break;
-
- case TRESP_SIM_GET_CALLFORWARDING: {
- const struct tresp_sim_read *resp_read = data;
- GVariant *gv_cf = NULL;
- GVariant *gv_cphs_cf = NULL;
- GVariantBuilder b;
-
- dbg("TRESP_SIM_GET_CALLFORWARDING - Result: [%s] CPHS: [%s]",
- (resp_read->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"),
- (resp_read->data.cf.b_cphs ? "Yes" : "No"));
-
- if (resp_read->data.cf.b_cphs) {
- dbg("b_line1[%d], b_line2[%d], b_fax[%d], b_data[%d]",
- resp_read->data.cf.cphs_cf.b_line1, resp_read->data.cf.cphs_cf.b_line2,
- resp_read->data.cf.cphs_cf.b_fax, resp_read->data.cf.cphs_cf.b_data);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "b_line1", g_variant_new_boolean(resp_read->data.cf.cphs_cf.b_line1));
- g_variant_builder_add(&b, "{sv}", "b_line2", g_variant_new_boolean(resp_read->data.cf.cphs_cf.b_line2));
- g_variant_builder_add(&b, "{sv}", "b_fax", g_variant_new_boolean(resp_read->data.cf.cphs_cf.b_fax));
- g_variant_builder_add(&b, "{sv}", "b_data", g_variant_new_boolean(resp_read->data.cf.cphs_cf.b_data));
- gv_cphs_cf = g_variant_builder_end(&b);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- gv_cf = g_variant_builder_end(&b);
-
- } else {
- int i =0;
-
- dbg("profile_count[%d]",resp_read->data.cf.cf_list.profile_count);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- for (i = 0; i < resp_read->data.cf.cf_list.profile_count; i++) {
- dbg("[%d] : rec_index[0x%x], msp_num[0x%x], cfu_status[0x%x], "
- "cfu_num[%s], ton[0x%x], npi[0x%x], cc2_id[0x%x], ext7_id[0x%x]",
- i, resp_read->data.cf.cf_list.cf[i].rec_index, resp_read->data.cf.cf_list.cf[i].msp_num,
- resp_read->data.cf.cf_list.cf[i].cfu_status, resp_read->data.cf.cf_list.cf[i].cfu_num,
- resp_read->data.cf.cf_list.cf[i].ton, resp_read->data.cf.cf_list.cf[i].npi,
- resp_read->data.cf.cf_list.cf[i].cc2_id, resp_read->data.cf.cf_list.cf[i].ext7_id);
-
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "rec_index", g_variant_new_int32(resp_read->data.cf.cf_list.cf[i].rec_index));
- g_variant_builder_add(&b, "{sv}", "msp_num", g_variant_new_byte(resp_read->data.cf.cf_list.cf[i].msp_num));
- g_variant_builder_add(&b, "{sv}", "cfu_status", g_variant_new_byte(resp_read->data.cf.cf_list.cf[i].cfu_status));
- g_variant_builder_add(&b, "{sv}", "cfu_num", g_variant_new_string(resp_read->data.cf.cf_list.cf[i].cfu_num));
- g_variant_builder_add(&b, "{sv}", "ton", g_variant_new_int32(resp_read->data.cf.cf_list.cf[i].ton));
- g_variant_builder_add(&b, "{sv}", "npi", g_variant_new_int32(resp_read->data.cf.cf_list.cf[i].npi));
- g_variant_builder_add(&b, "{sv}", "cc2_id", g_variant_new_byte(resp_read->data.cf.cf_list.cf[i].cc2_id));
- g_variant_builder_add(&b, "{sv}", "ext7_id", g_variant_new_byte(resp_read->data.cf.cf_list.cf[i].ext7_id));
- g_variant_builder_close(&b);
- }
- gv_cf = g_variant_builder_end(&b);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("a{sv}"));
- gv_cphs_cf = g_variant_builder_end(&b);
- }
-
- telephony_sim_complete_get_call_forwarding (dbus_info->interface_object, dbus_info->invocation,
- resp_read->result,
- resp_read->data.cf.b_cphs,
- gv_cf,
- gv_cphs_cf);
- }
- break;
-
- case TRESP_SIM_SET_CALLFORWARDING: {
- const struct tresp_sim_set_data *resp_set_data = data;
-
- dbg("TRESP_SIM_SET_CALLFORWARDING - Result: [%s]",
- (resp_set_data->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"));
-
- telephony_sim_complete_set_call_forwarding(dbus_info->interface_object, dbus_info->invocation,
- resp_set_data->result);
- }
- break;
-
- case TRESP_SIM_GET_MESSAGEWAITING: {
- const struct tresp_sim_read *resp_read = data;
- GVariant *gv_mw = NULL;
- GVariant *gv_cphs_mw = NULL;
- GVariantBuilder b;
-
- dbg("TRESP_SIM_GET_MESSAGEWAITING - Result: [%s] CPHS: [%s]",
- (resp_read->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"),
- (resp_read->data.mw.b_cphs ? "Yes" : "No"));
-
- if (resp_read->data.mw.b_cphs) {
- dbg("b_voice1[%d], b_voice2[%d], b_fax[%d], b_data[%d]",
- resp_read->data.mw.cphs_mw.b_voice1, resp_read->data.mw.cphs_mw.b_voice2,
- resp_read->data.mw.cphs_mw.b_fax, resp_read->data.mw.cphs_mw.b_data);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "b_voice1", g_variant_new_boolean(resp_read->data.mw.cphs_mw.b_voice1));
- g_variant_builder_add(&b, "{sv}", "b_voice2", g_variant_new_boolean(resp_read->data.mw.cphs_mw.b_voice2));
- g_variant_builder_add(&b, "{sv}", "b_fax", g_variant_new_boolean(resp_read->data.mw.cphs_mw.b_fax));
- g_variant_builder_add(&b, "{sv}", "b_data", g_variant_new_boolean(resp_read->data.mw.cphs_mw.b_data));
- gv_cphs_mw = g_variant_builder_end(&b);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- gv_mw = g_variant_builder_end(&b);
-
- } else {
- int i =0;
-
- dbg("profile_count[%d]", resp_read->data.mw.mw_list.profile_count);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- for (i = 0; i <resp_read->data.mw.mw_list.profile_count; i++) {
- dbg("[%d] : rec_index[0x%x], indicator_status[0x%x], voice_count[0x%x], "
- "fax_count[0x%x] email_count[0x%x], other_count[0x%x], video_count[0x%x]",
- i, resp_read->data.mw.mw_list.mw[i].rec_index, resp_read->data.mw.mw_list.mw[i].indicator_status,
- resp_read->data.mw.mw_list.mw[i].voice_count, resp_read->data.mw.mw_list.mw[i].fax_count,
- resp_read->data.mw.mw_list.mw[i].email_count, resp_read->data.mw.mw_list.mw[i].other_count,
- resp_read->data.mw.mw_list.mw[i].video_count);
-
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b,"{sv}", "rec_index", g_variant_new_int32( resp_read->data.mw.mw_list.mw[i].rec_index));
- g_variant_builder_add(&b, "{sv}", "indicator_status", g_variant_new_byte(resp_read->data.mw.mw_list.mw[i].indicator_status));
- g_variant_builder_add(&b,"{sv}", "voice_count", g_variant_new_int32(resp_read->data.mw.mw_list.mw[i].voice_count));
- g_variant_builder_add(&b,"{sv}", "fax_count", g_variant_new_int32(resp_read->data.mw.mw_list.mw[i].fax_count));
- g_variant_builder_add(&b, "{sv}", "email_count", g_variant_new_int32(resp_read->data.mw.mw_list.mw[i].email_count));
- g_variant_builder_add(&b, "{sv}", "other_count", g_variant_new_int32(resp_read->data.mw.mw_list.mw[i].other_count));
- g_variant_builder_add(&b, "{sv}", "video_count", g_variant_new_int32(resp_read->data.mw.mw_list.mw[i].video_count));
- g_variant_builder_close(&b);
- }
- gv_mw = g_variant_builder_end(&b);
- g_variant_builder_init(&b, G_VARIANT_TYPE("a{sv}"));
- gv_cphs_mw = g_variant_builder_end(&b);
- }
-
- telephony_sim_complete_get_message_waiting(dbus_info->interface_object, dbus_info->invocation,
- resp_read->result,
- resp_read->data.mw.b_cphs,
- gv_mw,
- gv_cphs_mw);
- }
- break;
-
- case TRESP_SIM_SET_MESSAGEWAITING: {
- const struct tresp_sim_set_data *resp_set_data = data;
-
- dbg("TRESP_SIM_SET_MESSAGEWAITING - Result: [%s]",
- (resp_set_data->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"));
-
- telephony_sim_complete_set_message_waiting(dbus_info->interface_object, dbus_info->invocation,
- resp_set_data->result);
- }
- break;
-
- case TRESP_SIM_GET_MAILBOX: {
- const struct tresp_sim_read *resp_read = data;
- GVariant *gv = NULL;
- GVariantBuilder b;
- int i =0;
-
- dbg("TRESP_SIM_GET_MAILBOX - Result: [%s] CPHS: [%s] Count: [%d])",
- (resp_read->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"),
- (resp_read->data.mb.b_cphs ? "Yes" : "No"),
- resp_read->data.mb.count);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- for (i =0; i < resp_read->data.mb.count; i++) {
- dbg("resp_read->data.mb.mb[%d] : "
- "rec_index[%d], profile_number[%d], mb_type[%d], alpha_id_max_len[%d]"
- "alpha_id[%s], ton[%d], npi[%d], num[%s], cc_id[%d], ext1_id[%d]",
- i, resp_read->data.mb.mb[i].rec_index, resp_read->data.mb.mb[i].profile_number,
- resp_read->data.mb.mb[i].mb_type, resp_read->data.mb.mb[i].number_info.alpha_id_max_len,
- resp_read->data.mb.mb[i].number_info.alpha_id, resp_read->data.mb.mb[i].number_info.ton,
- resp_read->data.mb.mb[i].number_info.npi, resp_read->data.mb.mb[i].number_info.num,
- resp_read->data.mb.mb[i].number_info.cc_id, resp_read->data.mb.mb[i].number_info.ext1_id);
-
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "rec_index", g_variant_new_int32(resp_read->data.mb.mb[i].rec_index));
- g_variant_builder_add(&b, "{sv}", "profile_num", g_variant_new_int32(resp_read->data.mb.mb[i].profile_number));
- g_variant_builder_add(&b, "{sv}", "mb_type", g_variant_new_int32(resp_read->data.mb.mb[i].mb_type));
- g_variant_builder_add(&b, "{sv}", "alpha_id_max_len", g_variant_new_int32(resp_read->data.mb.mb[i].number_info.alpha_id_max_len));
- g_variant_builder_add(&b, "{sv}", "alpha_id", g_variant_new_string(resp_read->data.mb.mb[i].number_info.alpha_id));
- g_variant_builder_add(&b, "{sv}", "ton", g_variant_new_int32(resp_read->data.mb.mb[i].number_info.ton));
- g_variant_builder_add(&b, "{sv}", "npi", g_variant_new_int32(resp_read->data.mb.mb[i].number_info.npi));
- g_variant_builder_add(&b, "{sv}", "num", g_variant_new_string(resp_read->data.mb.mb[i].number_info.num));
- g_variant_builder_add(&b, "{sv}", "cc_id", g_variant_new_byte(resp_read->data.mb.mb[i].number_info.cc_id));
- g_variant_builder_add(&b, "{sv}", "ext1_id", g_variant_new_byte(resp_read->data.mb.mb[i].number_info.ext1_id));
- g_variant_builder_close(&b);
- }
-
- gv = g_variant_builder_end(&b);
-
- telephony_sim_complete_get_mailbox (dbus_info->interface_object, dbus_info->invocation,
- resp_read->result,
- resp_read->data.mb.b_cphs,
- gv);
- }
- break;
-
- case TRESP_SIM_SET_MAILBOX: {
- const struct tresp_sim_set_data *resp_set_data = data;
-
- dbg("TRESP_SIM_SET_MAILBOX - Result: [%s]",
- (resp_set_data->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"));
-
- telephony_sim_complete_set_mailbox(dbus_info->interface_object, dbus_info->invocation,
- resp_set_data->result);
- }
- break;
-
- case TRESP_SIM_GET_CPHS_INFO: {
- const struct tresp_sim_read *resp_read = data;
-
- dbg("TRESP_SIM_GET_CPHS_INFO - Result: [%s]",
- (resp_read->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"));
-
- telephony_sim_complete_get_cphsinfo (dbus_info->interface_object, dbus_info->invocation,
- resp_read->result,
- resp_read->data.cphs.CphsPhase,
- resp_read->data.cphs.CphsServiceTable.bOperatorNameShortForm,
- resp_read->data.cphs.CphsServiceTable.bMailBoxNumbers,
- resp_read->data.cphs.CphsServiceTable.bServiceStringTable,
- resp_read->data.cphs.CphsServiceTable.bCustomerServiceProfile,
- resp_read->data.cphs.CphsServiceTable.bInformationNumbers);
- }
- break;
-
- case TRESP_SIM_GET_SERVICE_TABLE: {
- const struct tresp_sim_read *resp_read = data;
- CoreObject *co_sim = NULL;
- GVariantBuilder builder;
- GVariant * inner_gv = NULL;
- GVariant *svct_gv = NULL;
- int i =0;
-
- dbg("TRESP_SIM_GET_SERVICE_TABLE - Result: [%s]",
- (resp_read->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"));
-
- co_sim = __get_sim_co_from_ur(ctx->server, ur);
- if (!co_sim) {
- err("SIM Core object is NULL");
- return FALSE;
- }
-
- if (resp_read->result == SIM_ACCESS_SUCCESS) {
- tcore_sim_set_service_table(co_sim, &resp_read->data.svct);
- } else if (resp_read->result == SIM_ACCESS_FILE_NOT_FOUND) {
- tcore_sim_set_service_table(co_sim, NULL);
- }
-
- g_variant_builder_init (&builder, G_VARIANT_TYPE ("ay"));
-
- if (resp_read->data.svct.sim_type == SIM_TYPE_GSM) {
- for (i = 0; i < SIM_SST_SERVICE_CNT_MAX; i++) {
- g_variant_builder_add (&builder, "y", resp_read->data.svct.table.sst.service[i]);
- }
- } else if (resp_read->data.svct.sim_type == SIM_TYPE_USIM) {
- for (i = 0; i < SIM_UST_SERVICE_CNT_MAX; i++) {
- g_variant_builder_add (&builder, "y", resp_read->data.svct.table.ust.service[i]);
- }
- } else if(resp_read->data.svct.sim_type == SIM_TYPE_RUIM) {
- if(SIM_CDMA_SVC_TABLE == resp_read->data.svct.table.cst.cdma_svc_table) {
- for(i = 0; i < SIM_CDMA_ST_SERVICE_CNT_MAX; i++) {
- g_variant_builder_add (&builder, "iy", resp_read->data.svct.table.cst.cdma_svc_table,
- resp_read->data.svct.table.cst.service.cdma_service[i]);
- }
- } else if(SIM_CSIM_SVC_TABLE == resp_read->data.svct.table.cst.cdma_svc_table) {
- for(i = 0; i < SIM_CSIM_ST_SERVICE_CNT_MAX; i++) {
- g_variant_builder_add (&builder, "iy", resp_read->data.svct.table.cst.cdma_svc_table,
- resp_read->data.svct.table.cst.service.csim_service[i]);
- }
- } else {
- err("Invalid cdma_svc_table:[%d]", resp_read->data.svct.table.cst.cdma_svc_table);
- }
- } else {
- dbg("unknown sim type.");
- }
- inner_gv = g_variant_builder_end(&builder);
- svct_gv = g_variant_new("v", inner_gv);
-
- telephony_sim_complete_get_service_table (dbus_info->interface_object, dbus_info->invocation,
- resp_read->result,
- resp_read->data.svct.sim_type,
- svct_gv);
- } break;
-
- case TRESP_SIM_GET_SPN: {
- const struct tresp_sim_read *resp_read = data;
- CoreObject *co_sim = NULL;
-
- dbg("TRESP_SIM_GET_SPN - Result: [%s] Display condition: [%d] SPN: [%s]",
- (resp_read->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"),
- resp_read->data.spn.display_condition, (const gchar *)resp_read->data.spn.spn);
-
- co_sim = __get_sim_co_from_ur(ctx->server, ur);
- if (!co_sim) {
- err("SIM Core object is NULL");
- return FALSE;
- }
-
- if (resp_read->result == SIM_ACCESS_SUCCESS) {
- tcore_sim_set_spn(co_sim, &resp_read->data.spn);
- } else if (resp_read->result == SIM_ACCESS_FILE_NOT_FOUND) {
- tcore_sim_set_spn(co_sim, NULL);
- }
-
- telephony_sim_complete_get_spn (dbus_info->interface_object, dbus_info->invocation,
- resp_read->result,
- resp_read->data.spn.display_condition, (const gchar *)resp_read->data.spn.spn);
- }
- break;
-
- case TRESP_SIM_GET_CPHS_NETNAME: {
- const struct tresp_sim_read *resp_read = data;
- CoreObject *co_sim = NULL;
-
- dbg("TRESP_SIM_GET_CPHS_NETNAME - Result: [%s]",
- (resp_read->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"));
-
- co_sim = __get_sim_co_from_ur(ctx->server, ur);
- if (!co_sim) {
- err("SIM Core object is NULL");
- return FALSE;
- }
-
- if (resp_read->result == SIM_ACCESS_SUCCESS) {
- tcore_sim_set_cphs_netname(co_sim, &resp_read->data.cphs_net);
- } else if (resp_read->result == SIM_ACCESS_FILE_NOT_FOUND) {
- tcore_sim_set_cphs_netname(co_sim, NULL);
- }
-
- telephony_sim_complete_get_cphs_net_name (dbus_info->interface_object, dbus_info->invocation,
- resp_read->result,
- (const gchar *)resp_read->data.cphs_net.full_name, (const gchar *)resp_read->data.cphs_net.short_name);
- }
- break;
-
- case TRESP_SIM_GET_GID: {
- const struct tresp_sim_read *resp_read = data;
- GVariantBuilder *builder = NULL;
- GVariant * inner_gv = NULL;
- GVariant *gid_gv = NULL;
- int i =0;
-
- dbg("TRESP_SIM_GET_GID - Result: [%s]",
- (resp_read->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"));
-
- builder = g_variant_builder_new (G_VARIANT_TYPE ("ay"));
-
- for(i = 0; i < resp_read->data.gid.GroupIdentifierLen; i++) {
- g_variant_builder_add (builder, "y", resp_read->data.gid.szGroupIdentifier[i]);
- }
- inner_gv = g_variant_builder_end(builder);
- gid_gv = g_variant_new("v", inner_gv);
-
- telephony_sim_complete_get_gid (dbus_info->interface_object, dbus_info->invocation,
- resp_read->result,
- resp_read->data.gid.GroupIdentifierLen,
- gid_gv);
- }
- break;
-
- case TRESP_SIM_GET_MSISDN:{
- const struct tresp_sim_read *resp_read = data;
- CoreObject *co_sim = NULL;
- GVariant *gv = NULL;
- GVariantBuilder b;
- int i =0;
-
- dbg("TRESP_SIM_GET_MSISDN - Result: [%s]",
- (resp_read->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"));
-
- co_sim = __get_sim_co_from_ur(ctx->server, ur);
- if (!co_sim) {
- err("SIM Core object is NULL");
- return FALSE;
- }
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- if (resp_read->result == SIM_ACCESS_SUCCESS) {
- tcore_sim_set_msisdn_list(co_sim, &resp_read->data.msisdn_list);
- } else if (resp_read->result == SIM_ACCESS_FILE_NOT_FOUND) {
- tcore_sim_set_msisdn_list(co_sim, NULL);
- }
-
- for (i = 0; i < resp_read->data.msisdn_list.count; i++) {
- g_variant_builder_open(&b,G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "name", g_variant_new_string((const gchar *)resp_read->data.msisdn_list.msisdn[i].name));
- if (resp_read->data.msisdn_list.msisdn[i].ton == SIM_TON_INTERNATIONAL) {
- unsigned char *tmp = (unsigned char *)calloc(SIM_MSISDN_NUMBER_LEN_MAX + 1, 1);
- if (tmp!=NULL) {
- tmp[0] = '+';
- strncpy((char *)tmp+1, (const char*)resp_read->data.msisdn_list.msisdn[i].num, SIM_MSISDN_NUMBER_LEN_MAX - 1);
- tmp[SIM_MSISDN_NUMBER_LEN_MAX] = '\0';
- g_variant_builder_add(&b, "{sv}", "number", g_variant_new_string((const gchar *)tmp));
- free(tmp);
- } else {
- dbg("calloc failed.");
- g_variant_builder_add(&b, "{sv}", "number", g_variant_new_string((const gchar *)resp_read->data.msisdn_list.msisdn[i].num));
- }
- } else {
- g_variant_builder_add(&b, "{sv}", "number", g_variant_new_string((const gchar *)resp_read->data.msisdn_list.msisdn[i].num));
- }
- g_variant_builder_close(&b);
- }
- gv = g_variant_builder_end(&b);
-
- telephony_sim_complete_get_msisdn (dbus_info->interface_object, dbus_info->invocation,
- resp_read->result,
- gv);
- }
- break;
-
- case TRESP_SIM_GET_OPLMNWACT: {
- const struct tresp_sim_read *resp_read = data;
- GVariant *gv = NULL;
- GVariantBuilder b;
- int i =0;
-
- dbg("TRESP_SIM_GET_OPLMNWACT - Result: [%s]",
- (resp_read->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"));
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- for (i = 0;i < resp_read->data.opwa.opwa_count; i++) {
- g_variant_builder_open(&b,G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "plmn", g_variant_new_string((const gchar *)resp_read->data.opwa.opwa[i].plmn));
- g_variant_builder_add(&b, "{sv}", "b_umts", g_variant_new_boolean(resp_read->data.opwa.opwa[i].b_umts));
- g_variant_builder_add(&b, "{sv}", "b_gsm", g_variant_new_boolean(resp_read->data.opwa.opwa[i].b_gsm));
- g_variant_builder_close(&b);
- }
- gv = g_variant_builder_end(&b);
-
- telephony_sim_complete_get_oplmnwact (dbus_info->interface_object, dbus_info->invocation,
- resp_read->result,
- gv);
- }
- break;
-
- case TRESP_SIM_REQ_AUTHENTICATION: {
- const struct tresp_sim_req_authentication *resp_auth = data;
- GVariantBuilder builder;
- GVariant *ak = NULL;
- GVariant *cp = NULL;
- GVariant *it = NULL;
- GVariant *resp = NULL;
- GVariant *ak_gv = NULL;
- GVariant *cp_gv = NULL;
- GVariant *it_gv = NULL;
- GVariant *resp_gv = NULL;
- int i =0;
-
- dbg("TRESP_SIM_REQ_AUTHENTICATION - Result: [%s]",
- (resp_auth->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"));
-
- tcore_util_hex_dump("[AUTH_KEY] ", resp_auth->authentication_key_length, resp_auth->authentication_key);
- g_variant_builder_init (&builder, G_VARIANT_TYPE ("ay"));
- for (i = 0; i < (int)resp_auth->authentication_key_length; i++) {
- g_variant_builder_add (&builder, "y", resp_auth->authentication_key[i]);
- }
- ak = g_variant_builder_end(&builder);
- ak_gv = g_variant_new("v", ak);
-
- tcore_util_hex_dump("[CIPHER_DATA] ", resp_auth->cipher_length, resp_auth->cipher_data);
- g_variant_builder_init (&builder, G_VARIANT_TYPE ("ay"));
- for (i = 0; i < (int)resp_auth->cipher_length; i++) {
- g_variant_builder_add (&builder, "y", resp_auth->cipher_data[i]);
- }
- cp = g_variant_builder_end(&builder);
- cp_gv = g_variant_new("v", cp);
-
- tcore_util_hex_dump("[INTEGRITY_DATA] ", resp_auth->integrity_length, resp_auth->integrity_data);
- g_variant_builder_init (&builder, G_VARIANT_TYPE ("ay"));
- for (i = 0; i < (int)resp_auth->integrity_length; i++) {
- g_variant_builder_add (&builder, "y", resp_auth->integrity_data[i]);
- }
- it = g_variant_builder_end(&builder);
- it_gv = g_variant_new("v", it);
-
- tcore_util_hex_dump("[RESP_DATA] ", resp_auth->resp_length, resp_auth->resp_data);
- g_variant_builder_init (&builder, G_VARIANT_TYPE ("ay"));
- for (i = 0; i < (int)resp_auth->resp_length; i++) {
- g_variant_builder_add (&builder, "y", resp_auth->resp_data[i]);
- }
- resp = g_variant_builder_end(&builder);
- resp_gv = g_variant_new("v", resp);
-
- telephony_sim_complete_authentication (dbus_info->interface_object, dbus_info->invocation,
- resp_auth->result,
- resp_auth->auth_type,
- resp_auth->auth_result,
- ak_gv,
- cp_gv,
- it_gv,
- resp_gv);
- }
- break;
-
- case TRESP_SIM_VERIFY_PINS: {
- const struct tresp_sim_verify_pins *resp_verify_pins = data;
-
- dbg("TRESP_SIM_VERIFY_PINS - Result: [%s] PIN Type: [%d] Re-try count: [%d]",
- (resp_verify_pins->result == SIM_PIN_OPERATION_SUCCESS ? "Success" : "Fail"),
- resp_verify_pins->pin_type, resp_verify_pins->retry_count);
-
- telephony_sim_complete_verify_sec(dbus_info->interface_object, dbus_info->invocation,
- resp_verify_pins->result,
- resp_verify_pins->pin_type,
- resp_verify_pins->retry_count);
- }
- break;
-
- case TRESP_SIM_VERIFY_PUKS: {
- const struct tresp_sim_verify_puks *resp_verify_puks = data;
-
- dbg("TRESP_SIM_VERIFY_PUKS - Result: [%s] PIN Type: [%d] Re-try count: [%d]",
- (resp_verify_puks->result == SIM_PIN_OPERATION_SUCCESS ? "Success" : "Fail"),
- resp_verify_puks->pin_type, resp_verify_puks->retry_count);
-
- telephony_sim_complete_verify_puk (dbus_info->interface_object, dbus_info->invocation,
- resp_verify_puks->result,
- resp_verify_puks->pin_type,
- resp_verify_puks->retry_count);
- }
- break;
-
- case TRESP_SIM_CHANGE_PINS: {
- const struct tresp_sim_change_pins *resp_change_pins = data;
-
- dbg("TRESP_SIM_CHANGE_PINS - Result: [%s] PIN Type: [%d] Re-try count: [%d]",
- (resp_change_pins->result == SIM_PIN_OPERATION_SUCCESS ? "Success" : "Fail"),
- resp_change_pins->pin_type, resp_change_pins->retry_count);
-
- telephony_sim_complete_change_pin(dbus_info->interface_object, dbus_info->invocation,
- resp_change_pins->result,
- resp_change_pins->pin_type,
- resp_change_pins->retry_count);
- }
- break;
-
- case TRESP_SIM_DISABLE_FACILITY: {
- const struct tresp_sim_disable_facility *resp_dis_facility = data;
- gint f_type =0;
-
- dbg("TRESP_SIM_DISABLE_FACILITY - Result: [%s] Type: [%d] Re-try count: [%d]",
- (resp_dis_facility->result == SIM_PIN_OPERATION_SUCCESS ? "Success" : "Fail"),
- resp_dis_facility->type, resp_dis_facility->retry_count);
-
- switch (resp_dis_facility->type) {
- case SIM_FACILITY_PS:
- f_type = 1;
- break;
- case SIM_FACILITY_SC:
- f_type = 3;
- break;
- case SIM_FACILITY_FD:
- f_type = 4;
- break;
- case SIM_FACILITY_PN:
- f_type = 5;
- break;
- case SIM_FACILITY_PU:
- f_type = 6;
- break;
- case SIM_FACILITY_PP:
- f_type = 7;
- break;
- case SIM_FACILITY_PC:
- f_type = 8;
- break;
- default:
- err("Unhandled/Unknown type[0x%x]", resp_dis_facility->type);
- break;
- }
-
- telephony_sim_complete_disable_facility(dbus_info->interface_object, dbus_info->invocation,
- resp_dis_facility->result,
- f_type,
- resp_dis_facility->retry_count);
- }
- break;
-
- case TRESP_SIM_ENABLE_FACILITY: {
- const struct tresp_sim_enable_facility *resp_en_facility = data;
- gint f_type =0;
-
- dbg("TRESP_SIM_ENABLE_FACILITY - Result: [%s] Type: [%d] Re-try count: [%d]",
- (resp_en_facility->result == SIM_PIN_OPERATION_SUCCESS ? "Success" : "Fail"),
- resp_en_facility->type, resp_en_facility->retry_count);
-
- switch (resp_en_facility->type) {
- case SIM_FACILITY_PS:
- f_type = 1;
- break;
- case SIM_FACILITY_SC:
- f_type = 3;
- break;
- case SIM_FACILITY_FD:
- f_type = 4;
- break;
- case SIM_FACILITY_PN:
- f_type = 5;
- break;
- case SIM_FACILITY_PU:
- f_type = 6;
- break;
- case SIM_FACILITY_PP:
- f_type = 7;
- break;
- case SIM_FACILITY_PC:
- f_type = 8;
- break;
- default:
- err("Unhandled/Unknown type[0x%x]", resp_en_facility->type);
- break;
- }
-
- telephony_sim_complete_enable_facility(dbus_info->interface_object, dbus_info->invocation,
- resp_en_facility->result,
- f_type,
- resp_en_facility->retry_count);
- }
- break;
-
- case TRESP_SIM_GET_FACILITY_STATUS: {
- const struct tresp_sim_get_facility_status *resp_get_facility = data;
- gint f_type =0;
-
- dbg("TRESP_SIM_GET_FACILITY_STATUS - Result: [%s] Type: [%d] Enable: [%s]",
- (resp_get_facility->result == SIM_PIN_OPERATION_SUCCESS ? "Success" : "Fail"),
- resp_get_facility->type,
- (resp_get_facility->b_enable ? "Yes" : "No"));
-
- switch (resp_get_facility->type) {
- case SIM_FACILITY_PS:
- f_type = 1;
- break;
- case SIM_FACILITY_SC:
- f_type = 3;
- break;
- case SIM_FACILITY_FD:
- f_type = 4;
- break;
- case SIM_FACILITY_PN:
- f_type = 5;
- break;
- case SIM_FACILITY_PU:
- f_type = 6;
- break;
- case SIM_FACILITY_PP:
- f_type = 7;
- break;
- case SIM_FACILITY_PC:
- f_type = 8;
- break;
- default:
- err("Unhandled/Unknown type[0x%x]", resp_get_facility->type);
- break;
- }
-
- telephony_sim_complete_get_facility(dbus_info->interface_object, dbus_info->invocation,
- resp_get_facility->result,
- f_type,
- resp_get_facility->b_enable);
- }
- break;
-
- case TRESP_SIM_GET_LOCK_INFO: {
- const struct tresp_sim_get_lock_info *resp_lock = data;
- gint f_type =0;
-
- dbg("TRESP_SIM_GET_LOCK_INFO - Result: [%s] Type: [%d] Re-try count: [%d]",
- (resp_lock->result == SIM_PIN_OPERATION_SUCCESS ? "Success" : "Fail"),
- resp_lock->type, resp_lock->retry_count);
-
- switch (resp_lock->type) {
- case SIM_FACILITY_PS:
- f_type = 1;
- break;
- case SIM_FACILITY_SC:
- f_type = 3;
- break;
- case SIM_FACILITY_FD:
- f_type = 4;
- break;
- case SIM_FACILITY_PN:
- f_type = 5;
- break;
- case SIM_FACILITY_PU:
- f_type = 6;
- break;
- case SIM_FACILITY_PP:
- f_type = 7;
- break;
- case SIM_FACILITY_PC:
- f_type = 8;
- break;
- default:
- err("Unhandled/Unknown type[0x%x]", resp_lock->type);
- break;
- }
-
- telephony_sim_complete_get_lock_info(dbus_info->interface_object, dbus_info->invocation,
- resp_lock->result,
- f_type,
- resp_lock->lock_status,
- resp_lock->retry_count);
- }
- break;
-
- case TRESP_SIM_TRANSMIT_APDU: {
- const struct tresp_sim_transmit_apdu *resp_apdu = data;
- GVariantBuilder builder;
- GVariant * apdu_gv = NULL;
- GVariant *inner_gv = NULL;
- int i =0;
-
- dbg("TRESP_SIM_TRANSMIT_APDU - Result: [%s]",
- (resp_apdu->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"));
- tcore_util_hex_dump("[APDU_RESP] ",
- resp_apdu->apdu_resp_length, resp_apdu->apdu_resp);
-
- g_variant_builder_init (&builder, G_VARIANT_TYPE ("ay"));
- for (i = 0; i < (int)resp_apdu->apdu_resp_length; i++) {
- g_variant_builder_add (&builder, "y", resp_apdu->apdu_resp[i]);
- }
- inner_gv = g_variant_builder_end(&builder);
- apdu_gv = g_variant_new("v", inner_gv);
-
- telephony_sim_complete_transfer_apdu(dbus_info->interface_object, dbus_info->invocation,
- resp_apdu->result,
- apdu_gv);
- }
- break;
-
- case TRESP_SIM_GET_ATR:{
- const struct tresp_sim_get_atr *resp_get_atr = data;
- GVariantBuilder builder;
- GVariant * atr_gv = NULL;
- GVariant *inner_gv = NULL;
- int i =0;
-
- dbg("TRESP_SIM_GET_ATR - Result: [%s]",
- (resp_get_atr->result == SIM_ACCESS_SUCCESS ? "Success" : "Fail"));
- tcore_util_hex_dump("[ATR_RESP] ",
- resp_get_atr->atr_length, resp_get_atr->atr);
-
- g_variant_builder_init (&builder, G_VARIANT_TYPE ("ay"));
- for (i = 0; i < (int)resp_get_atr->atr_length; i++) {
- g_variant_builder_add (&builder, "y", resp_get_atr->atr[i]);
- }
- inner_gv = g_variant_builder_end(&builder);
- atr_gv = g_variant_new("v", inner_gv);
-
- telephony_sim_complete_get_atr(dbus_info->interface_object, dbus_info->invocation,
- resp_get_atr->result,
- atr_gv);
- }
- break;
-
- case TRESP_SIM_SET_POWERSTATE: {
- const struct tresp_sim_set_powerstate *resp_power = data;
-
- dbg("TRESP_SIM_SET_POWERSTATE - Result: [%s]",
- (resp_power->result == SIM_POWER_SET_SUCCESS ? "Success" : "Fail"));
-
- telephony_sim_complete_set_powerstate(dbus_info->interface_object, dbus_info->invocation,
- resp_power->result);
- }
- break;
-
- default:
- err("Unhandled/Unknown Response!!!");
- break;
- }
-
- return TRUE;
-}
-
-gboolean dbus_plugin_sim_notification(struct custom_data *ctx, CoreObject *source,
- TelephonyObjectSkeleton *object, enum tcore_notification_command command,
- unsigned int data_len, const void *data)
-{
- TelephonySim *sim;
- const char *cp_name;
-
- cp_name = tcore_server_get_cp_name_by_plugin(tcore_object_ref_plugin(source));
-
- sim = telephony_object_peek_sim(TELEPHONY_OBJECT(object));
- dbg("sim: [%p]", sim);
-
- switch (command) {
- case TNOTI_SIM_STATUS: {
- const struct tnoti_sim_status *n_sim_status = data;
-
- info("[DBUSINFO][%s] SIM_STATUS : [%d]", cp_name, n_sim_status->sim_status);
-
-#ifdef ENABLE_KPI_LOGS
- if (n_sim_status->sim_status == SIM_STATUS_INIT_COMPLETED)
- TIME_CHECK("[%s] SIM Initialized", cp_name);
-#endif
-
- telephony_sim_emit_status(sim, n_sim_status->sim_status);
- }
- break;
-
- case TNOTI_SIM_REFRESHED: {
- const struct tnoti_sim_refreshed *n_sim_refreshed = data;
- info("[DBUSINFO][%s] SIM_REFRESHED : b_full_file_changed: [%s] changed_file_count: [%d]",
- cp_name, (n_sim_refreshed->b_full_file_changed ? "Yes" : "No"), n_sim_refreshed->file_list.file_count);
-
- telephony_sim_emit_refreshed(sim, n_sim_refreshed->cmd_type);
- }
- break;
-
- case TNOTI_SIM_CALL_FORWARD_STATE: {
- const struct tnoti_sim_call_forward_state *info = data;
- info("[DBUSINFO][%s] SIM_CALL_FORWARD_STATE : [%s]",
- cp_name, info->b_forward ? "ON" : "OFF");
-
- telephony_sim_set_cf_state(sim, info->b_forward);
- }
- break;
-
- default:
- err("Unhandled/Unknown Notification!!!");
- break;
- }
-
- return TRUE;
-}
-
+++ /dev/null
-/*
- * tel-plugin-socket-communicator
- *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <pthread.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <time.h>
-#include <glib.h>
-#include <gio/gio.h>
-
-#include <tcore.h>
-#include <server.h>
-#include <plugin.h>
-#include <hal.h>
-#include <communicator.h>
-#include <storage.h>
-#include <queue.h>
-#include <user_request.h>
-#include <co_sms.h>
-
-#include "generated-code.h"
-#include "common.h"
-
-TReturn ret = TCORE_RETURN_SUCCESS;
-
-static gboolean
-on_sms_send_msg(TelephonySms *sms, GDBusMethodInvocation *invocation,
- GVariant *sca,
- gint tpdu_length,
- GVariant *tpdu_data,
- gint moreMsg,
- gpointer user_data)
-{
- struct treq_sms_send_umts_msg sendUmtsMsg;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- int i = 0;
- GVariantIter *iter = 0;
- GVariant *inner_gv = 0;
-
- if (!check_access_control (invocation, AC_SMS, "x"))
- return TRUE;
-
- memset(&sendUmtsMsg, 0 , sizeof(struct treq_sms_send_umts_msg));
-
- inner_gv = g_variant_get_variant( sca );
- g_variant_get(inner_gv, "ay", &iter);
- while( g_variant_iter_loop(iter, "y", &sendUmtsMsg.msgDataPackage.sca[i] ) ) {
- i++;
- if( i >= SMS_SMSP_ADDRESS_LEN )
- break;
- }
-
- sendUmtsMsg.msgDataPackage.msgLength = tpdu_length;
-
- i = 0;
- inner_gv = g_variant_get_variant( tpdu_data );
- g_variant_get(inner_gv, "ay", &iter);
- while( g_variant_iter_loop(iter, "y", &sendUmtsMsg.msgDataPackage.tpduData[i] ) ) {
- i++;
- if( i >= SMS_SMDATA_SIZE_MAX + 1 )
- break;
- }
- g_variant_iter_free(iter);
- g_variant_unref(inner_gv);
-
- sendUmtsMsg.more = moreMsg;
-
- ur = MAKE_UR(ctx, sms, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sms_send_umts_msg), &sendUmtsMsg);
- tcore_user_request_set_command(ur, TREQ_SMS_SEND_UMTS_MSG);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-/*
-
-static gboolean
-on_sms_send_cdma_msg(TelephonySms *sms, GDBusMethodInvocation *invocation,
- const gchar *sca,
- gint tpdu_length,
- const gchar *tpdu_data,
- gint moreMsg,
- gpointer user_data)
-{
-#if 0
- cdmaMsg.more = sipc_util_marshal_object_get_int(in_obj, "More");
- cdmaMsg.cdmaMsgInfo.ParamMask = sipc_util_marshal_object_get_int(in_obj, "ParamMask");
- cdmaMsg.cdmaMsgInfo.MsgType = sipc_util_marshal_object_get_int(in_obj, "MsgType");
-
- switch(cdmaMsg.cdmaMsgInfo.MsgType)
- {
- case SMS_MESSAGETYPE_SUBMIT: {
- gchar *dstAddr_szAddress;
- gchar *dstSubAddr_szAddress;
- gchar *szData;
- gchar *callBackNumer_szAddress;
-
- Origination address
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DstAddr.Digit = sipc_util_marshal_object_get_int(in_obj, "DstAddr.Digit");
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DstAddr.NumberMode = sipc_util_marshal_object_get_int(in_obj, "DstAddr.NumberMode");
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DstAddr.NumberType = sipc_util_marshal_object_get_int(in_obj, "DstAddr.NumberType");
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DstAddr.NumberPlan = sipc_util_marshal_object_get_int(in_obj, "DstAddr.NumberPlan");
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DstAddr.szAddrLength = sipc_util_marshal_object_get_char(in_obj, "DstAddr.szAddrLength");
- dstAddr_szAddress = sipc_util_marshal_object_get_string(in_obj, "DstAddr.szAddress");
- memcpy(&(cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DstAddr.szAddress[0]), dstAddr_szAddress, SMS_MAXLENGTH_SMS_ADDRESS);
-
- Origination subaddress
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DstSubAddr.SubType = sipc_util_marshal_object_get_int(in_obj, "DstSubAddr.SubType");
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DstSubAddr.Odd = sipc_util_marshal_object_get_char(in_obj, "DstSubAddr.Odd");
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DstSubAddr.szAddrLength = sipc_util_marshal_object_get_char(in_obj, "DstSubAddr.szAddrLength");
- dstSubAddr_szAddress = sipc_util_marshal_object_get_string(in_obj, "DstSubAddr.szAddress");
- memcpy(&(cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DstSubAddr.szAddress[0]), dstSubAddr_szAddress, SMS_MAXLENGTH_SMS_ADDRESS);
-
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.TeleService = sipc_util_marshal_object_get_int(in_obj, "TeleService");
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.bBearerReplySeqRequest = sipc_util_marshal_object_get_int(in_obj, "bBearerReplySeqRequest");
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.ReplySeqNumber = sipc_util_marshal_object_get_char(in_obj, "ReplySeqNumber");
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.MsgId = sipc_util_marshal_object_get_int(in_obj, "MsgId");
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.MsgEncoding = sipc_util_marshal_object_get_int(in_obj, "MsgEncoding");
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.MsgLength = sipc_util_marshal_object_get_int(in_obj, "MsgLength");
- szData = sipc_util_marshal_object_get_string(in_obj, "szData");
- memcpy(&(cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.szData[0]), szData, SMS_MAXLENGTH_SMS_MO_USER_DATA);
-
- Validity period - Absolute
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.ValidityPeriodAbs.year = sipc_util_marshal_object_get_int(in_obj, "ValidityPeriodAbs.year");
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.ValidityPeriodAbs.month = sipc_util_marshal_object_get_int(in_obj, "ValidityPeriodAbs.month");
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.ValidityPeriodAbs.day = sipc_util_marshal_object_get_int(in_obj, "ValidityPeriodAbs.day");
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.ValidityPeriodAbs.hours = sipc_util_marshal_object_get_int(in_obj, "ValidityPeriodAbs.hours");
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.ValidityPeriodAbs.minutes = sipc_util_marshal_object_get_int(in_obj, "ValidityPeriodAbs.minutes");
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.ValidityPeriodAbs.seconds = sipc_util_marshal_object_get_int(in_obj, "ValidityPeriodAbs.seconds");
-
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.ValidityPeriodRel = sipc_util_marshal_object_get_char(in_obj, "ValidityPeriodRel");
-
- Deferred delivery time - Absolute (not supported)
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DeferredDelTimeAbs.year = sipc_util_marshal_object_get_int(in_obj, "DeferredDelTimeAbs.year");
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DeferredDelTimeAbs.month = sipc_util_marshal_object_get_int(in_obj, "DeferredDelTimeAbs.month");
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DeferredDelTimeAbs.day = sipc_util_marshal_object_get_int(in_obj, "DeferredDelTimeAbs.day");
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DeferredDelTimeAbs.hours = sipc_util_marshal_object_get_int(in_obj, "DeferredDelTimeAbs.hours");
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DeferredDelTimeAbs.minutes = sipc_util_marshal_object_get_int(in_obj, "DeferredDelTimeAbs.minutes");
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DeferredDelTimeAbs.seconds = sipc_util_marshal_object_get_int(in_obj, "DeferredDelTimeAbs.seconds");
-
- Deferred delivery time - Relative (not supported)
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DeferredDelTimeRel = sipc_util_marshal_object_get_char(in_obj, "DeferredDelTimeRel");
-
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.Priority = sipc_util_marshal_object_get_int(in_obj, "Priority");
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.Privacy = sipc_util_marshal_object_get_int(in_obj, "Privacy");
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.bUserAckRequest = sipc_util_marshal_object_get_int(in_obj, "bUserAckRequest");
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.bDeliveryAckRequest = sipc_util_marshal_object_get_int(in_obj, "bDeliveryAckRequest");
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.AlertPriority= sipc_util_marshal_object_get_int(in_obj, "AlertPriority");
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.MsgLang= sipc_util_marshal_object_get_int(in_obj, "MsgLang");
-
- Callback number address
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.CallBackNumber.Digit = sipc_util_marshal_object_get_int(in_obj, "CallBackNumer.Digit");
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.CallBackNumber.NumberMode = sipc_util_marshal_object_get_int(in_obj, "CallBackNumer.NumberMode");
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.CallBackNumber.NumberType = sipc_util_marshal_object_get_int(in_obj, "CallBackNumer.NumberType");
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.CallBackNumber.NumberPlan = sipc_util_marshal_object_get_int(in_obj, "CallBackNumer.NumberPlan");
- cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.CallBackNumber.szAddrLength = sipc_util_marshal_object_get_char(in_obj, "CallBackNumer.szAddrLength");
- callBackNumer_szAddress = sipc_util_marshal_object_get_string(in_obj, "CallBackNumer.szAddress");
- memcpy(&(cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.CallBackNumber.szAddress[0]), callBackNumer_szAddress, SMS_MAXLENGTH_SMS_ADDRESS);
-
- }
- break;
-
- case SMS_MESSAGETYPE_CANCEL: {
- gchar *dstAddr_szAddress;
- gchar *dstSubAddr_szAddress;
-
- Origination address
- cdmaMsg.cdmaMsgInfo.MsgData.outCancel.DstAddr.Digit = sipc_util_marshal_object_get_int(in_obj, "DstAddr.Digit");
- cdmaMsg.cdmaMsgInfo.MsgData.outCancel.DstAddr.NumberMode = sipc_util_marshal_object_get_int(in_obj, "DstAddr.NumberMode");
- cdmaMsg.cdmaMsgInfo.MsgData.outCancel.DstAddr.NumberType = sipc_util_marshal_object_get_int(in_obj, "DstAddr.NumberType");
- cdmaMsg.cdmaMsgInfo.MsgData.outCancel.DstAddr.NumberPlan = sipc_util_marshal_object_get_int(in_obj, "DstAddr.NumberPlan");
- cdmaMsg.cdmaMsgInfo.MsgData.outCancel.DstAddr.szAddrLength = sipc_util_marshal_object_get_char(in_obj, "DstAddr.szAddrLength");
- dstAddr_szAddress = sipc_util_marshal_object_get_string(in_obj, "DstAddr.szAddress");
- memcpy(&(cdmaMsg.cdmaMsgInfo.MsgData.outCancel.DstAddr.szAddress[0]), dstAddr_szAddress, SMS_MAXLENGTH_SMS_ADDRESS);
-
- Origination subaddress
- cdmaMsg.cdmaMsgInfo.MsgData.outCancel.DstSubAddr.SubType = sipc_util_marshal_object_get_int(in_obj, "DstSubAddr.SubType");
- cdmaMsg.cdmaMsgInfo.MsgData.outCancel.DstSubAddr.Odd = sipc_util_marshal_object_get_char(in_obj, "DstSubAddr.Odd");
- cdmaMsg.cdmaMsgInfo.MsgData.outCancel.DstSubAddr.szAddrLength = sipc_util_marshal_object_get_char(in_obj, "DstSubAddr.szAddrLength");
- dstSubAddr_szAddress = sipc_util_marshal_object_get_string(in_obj, "DstSubAddr.szAddress");
- memcpy(&(cdmaMsg.cdmaMsgInfo.MsgData.outCancel.DstSubAddr.szAddress[0]), dstSubAddr_szAddress, SMS_MAXLENGTH_SMS_ADDRESS);
-
- cdmaMsg.cdmaMsgInfo.MsgData.outCancel.TeleService = sipc_util_marshal_object_get_int(in_obj, "TeleService");
- cdmaMsg.cdmaMsgInfo.MsgData.outCancel.bBearerReplySeqRequest = sipc_util_marshal_object_get_int(in_obj, "bBearerReplySeqRequest");
- cdmaMsg.cdmaMsgInfo.MsgData.outCancel.ReplySeqNumber = sipc_util_marshal_object_get_char(in_obj, "ReplySeqNumber");
- cdmaMsg.cdmaMsgInfo.MsgData.outCancel.MsgId = sipc_util_marshal_object_get_int(in_obj, "MsgId");
-
- }
- break;
-
- case SMS_MESSAGETYPE_USER_ACK: {
- gchar *dstAddr_szAddress;
- gchar *dstSubAddr_szAddress;
- gchar *szData;
-
- Origination address
- cdmaMsg.cdmaMsgInfo.MsgData.outAck.DstAddr.Digit = sipc_util_marshal_object_get_int(in_obj, "DstAddr.Digit");
- cdmaMsg.cdmaMsgInfo.MsgData.outAck.DstAddr.NumberMode = sipc_util_marshal_object_get_int(in_obj, "DstAddr.NumberMode");
- cdmaMsg.cdmaMsgInfo.MsgData.outAck.DstAddr.NumberType = sipc_util_marshal_object_get_int(in_obj, "DstAddr.NumberType");
- cdmaMsg.cdmaMsgInfo.MsgData.outAck.DstAddr.NumberPlan = sipc_util_marshal_object_get_int(in_obj, "DstAddr.NumberPlan");
- cdmaMsg.cdmaMsgInfo.MsgData.outAck.DstAddr.szAddrLength = sipc_util_marshal_object_get_char(in_obj, "DstAddr.szAddrLength");
- dstAddr_szAddress = sipc_util_marshal_object_get_string(in_obj, "DstAddr.szAddress");
- memcpy(&(cdmaMsg.cdmaMsgInfo.MsgData.outAck.DstAddr.szAddress[0]), dstAddr_szAddress, SMS_MAXLENGTH_SMS_ADDRESS);
-
- Origination subaddress
- cdmaMsg.cdmaMsgInfo.MsgData.outAck.DstSubAddr.SubType = sipc_util_marshal_object_get_int(in_obj, "DstSubAddr.SubType");
- cdmaMsg.cdmaMsgInfo.MsgData.outAck.DstSubAddr.Odd = sipc_util_marshal_object_get_char(in_obj, "DstSubAddr.Odd");
- cdmaMsg.cdmaMsgInfo.MsgData.outAck.DstSubAddr.szAddrLength = sipc_util_marshal_object_get_char(in_obj, "DstSubAddr.szAddrLength");
- dstSubAddr_szAddress = sipc_util_marshal_object_get_string(in_obj, "DstSubAddr.szAddress");
- memcpy(&(cdmaMsg.cdmaMsgInfo.MsgData.outAck.DstSubAddr.szAddress[0]), dstSubAddr_szAddress, SMS_MAXLENGTH_SMS_ADDRESS);
-
- cdmaMsg.cdmaMsgInfo.MsgData.outAck.TeleService = sipc_util_marshal_object_get_int(in_obj, "TeleService");
- cdmaMsg.cdmaMsgInfo.MsgData.outAck.bBearerReplySeqRequest = sipc_util_marshal_object_get_int(in_obj, "bBearerReplySeqRequest");
- cdmaMsg.cdmaMsgInfo.MsgData.outAck.ReplySeqNumber = sipc_util_marshal_object_get_char(in_obj, "ReplySeqNumber");
- cdmaMsg.cdmaMsgInfo.MsgData.outAck.MsgId = sipc_util_marshal_object_get_int(in_obj, "MsgId");
- cdmaMsg.cdmaMsgInfo.MsgData.outAck.MsgEncoding = sipc_util_marshal_object_get_int(in_obj, "MsgEncoding");
- cdmaMsg.cdmaMsgInfo.MsgData.outAck.MsgLength = sipc_util_marshal_object_get_int(in_obj, "MsgLength");
- szData = sipc_util_marshal_object_get_string(in_obj, "szData");
- memcpy(&(cdmaMsg.cdmaMsgInfo.MsgData.outAck.szData[0]), szData, SMS_MAXLENGTH_SMS_MO_USER_DATA);
- cdmaMsg.cdmaMsgInfo.MsgData.outAck.UserResponseCode = sipc_util_marshal_object_get_char(in_obj, "UserResponseCode");
-
- }
- break;
- default:
- break;
- }
-
- tcore_user_request_set_data(ur, sizeof(struct treq_sms_send_cdma_msg), &cdmaMsg);
- tcore_user_request_set_command(ur, TREQ_SMS_SEND_CDMA_MSG);
-
- ret = tcore_communicator_dispatch_request(comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- // api_err = TAPI_API_OPERATION_FAILED;
- err("[tcore_SMS] communicator_dispatch_request is fail [0x%x] !!!", ret);
- return FALSE;
- }
-#endif
- return TRUE;
-}
-
-*/
-
-static gboolean
-on_sms_read_msg(TelephonySms *sms, GDBusMethodInvocation *invocation,
- gint arg_index,
- gpointer user_data)
-{
- struct treq_sms_read_msg readMsg = {0,};
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- if (!check_access_control (invocation, AC_SMS, "r"))
- return TRUE;
-
- readMsg.index = arg_index;
-
- ur = MAKE_UR(ctx, sms, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sms_read_msg), &readMsg);
- tcore_user_request_set_command(ur, TREQ_SMS_READ_MSG);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_sms_save_msg(TelephonySms *sms, GDBusMethodInvocation *invocation,
- gint arg_msg_status,
- GVariant * arg_sca,
- gint arg_tpdu_length,
- GVariant * arg_tpdu_data,
- gpointer user_data)
-{
- struct treq_sms_save_msg saveMsg = {0,};
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- int i = 0;
- GVariantIter *iter = 0;
- GVariant *inner_gv = 0;
-
- if (!check_access_control (invocation, AC_SMS, "w"))
- return TRUE;
-
- saveMsg.simIndex = 0xffff;
- saveMsg.msgStatus = arg_msg_status;
-
- inner_gv = g_variant_get_variant( arg_sca );
- g_variant_get(inner_gv, "ay", &iter);
- while( g_variant_iter_loop(iter, "y", &saveMsg.msgDataPackage.sca[i] ) ) {
- i++;
- if( i >= SMS_SMSP_ADDRESS_LEN )
- break;
- }
-
- i = 0;
- inner_gv = g_variant_get_variant( arg_tpdu_data );
- g_variant_get(inner_gv, "ay", &iter);
- while( g_variant_iter_loop(iter, "y", &saveMsg.msgDataPackage.tpduData[i] ) ) {
- i++;
- if( i >= SMS_SMDATA_SIZE_MAX + 1 )
- break;
- }
- g_variant_iter_free(iter);
- g_variant_unref(inner_gv);
-
- saveMsg.msgDataPackage.msgLength = arg_tpdu_length;
-
- ur = MAKE_UR(ctx, sms, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sms_save_msg), &saveMsg);
- tcore_user_request_set_command(ur, TREQ_SMS_SAVE_MSG);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_sms_delete_msg(TelephonySms *sms, GDBusMethodInvocation *invocation,
- gint arg_index,
- gpointer user_data)
-{
- struct treq_sms_delete_msg deleteMsg = {0,};
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- if (!check_access_control (invocation, AC_SMS, "x"))
- return TRUE;
-
- deleteMsg.index = arg_index;
-
- ur = MAKE_UR(ctx, sms, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sms_delete_msg), &deleteMsg);
- tcore_user_request_set_command(ur, TREQ_SMS_DELETE_MSG);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_sms_get_msg_count(TelephonySms *sms, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- if (!check_access_control (invocation, AC_SMS, "r"))
- return TRUE;
-
- ur = MAKE_UR(ctx, sms, invocation);
- tcore_user_request_set_data(ur, 0, NULL);
- tcore_user_request_set_command(ur, TREQ_SMS_GET_COUNT);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_sms_get_sca(TelephonySms *sms, GDBusMethodInvocation *invocation,
- gint arg_index,
- gpointer user_data)
-{
- struct treq_sms_get_sca getSca = {0,};
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- if (!check_access_control (invocation, AC_SMS, "r"))
- return TRUE;
-
- getSca.index = arg_index;
-
- ur = MAKE_UR(ctx, sms, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sms_get_sca), &getSca);
- tcore_user_request_set_command(ur, TREQ_SMS_GET_SCA);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_sms_set_sca(TelephonySms *sms, GDBusMethodInvocation *invocation,
- gint arg_index,
- gint arg_ton,
- gint arg_npi,
- gint arg_dialNumberLength,
- GVariant *arg_dialNumber,
- gpointer user_data)
-{
- struct treq_sms_set_sca setSca;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- int i = 0;
- GVariantIter *iter = 0;
- GVariant *inner_gv = 0;
-
- if (!check_access_control (invocation, AC_SMS, "w"))
- return TRUE;
-
- memset(&setSca, 0, sizeof(struct treq_sms_set_sca));
-
- setSca.index = arg_index;
- setSca.scaInfo.dialNumLen = arg_dialNumberLength;
- setSca.scaInfo.typeOfNum = arg_ton;
- setSca.scaInfo.numPlanId = arg_npi;
-
- if ((setSca.scaInfo.dialNumLen <= 0) || (setSca.scaInfo.dialNumLen > (SMS_MAX_SMS_SERVICE_CENTER_ADDR + 1)))
- {
- err("[tcore_SMS] TAPI_API_INVALID_INPUT !!!");
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- return TRUE;
- }
- else if(setSca.index != 0)
- {
- err("[tcore_SMS] Index except 0 is supported");
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- return TRUE;
- }
- else
- {
- inner_gv = g_variant_get_variant( arg_dialNumber );
- g_variant_get(inner_gv, "ay", &iter);
- while( g_variant_iter_loop(iter, "y", &setSca.scaInfo.diallingNum[i] ) ) {
- i++;
- if( i >= SMS_SMSP_ADDRESS_LEN + 1 )
- break;
- }
-
- ur = MAKE_UR(ctx, sms, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sms_set_sca), &setSca);
- tcore_user_request_set_command(ur, TREQ_SMS_SET_SCA);
-
- g_variant_iter_free(iter);
- g_variant_unref(inner_gv);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
- }
-
- return TRUE;
-}
-
-static gboolean
-on_sms_get_cb_config(TelephonySms *sms, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- if (!check_access_control (invocation, AC_SMS, "r"))
- return TRUE;
-
- ur = MAKE_UR(ctx, sms, invocation);
- tcore_user_request_set_data(ur, 0, NULL);
- tcore_user_request_set_command(ur, TREQ_SMS_GET_CB_CONFIG);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_sms_set_cb_config(TelephonySms *sms, GDBusMethodInvocation *invocation,
- gint arg_net3gppType,
- gboolean arg_cbEnable,
- gint arg_msgIdMaxCount,
- gint arg_msgIdRangeCount,
- GVariant *arg_mdgId,
- gpointer user_data)
-{
- struct treq_sms_set_cb_config setCbConfig = {0,};
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- GVariant *value = NULL;
- GVariant *inner_gv = 0;
- GVariantIter *iter = NULL;
- GVariantIter *iter_row = NULL;
- const gchar *key = NULL;
- int i = 0;
-
- if (!check_access_control (invocation, AC_SMS, "w"))
- return TRUE;
-
- setCbConfig.net3gppType = arg_net3gppType;
- setCbConfig.cbEnabled = arg_cbEnable;
- setCbConfig.msgIdMaxCount = arg_msgIdMaxCount;
- setCbConfig.msgIdRangeCount = arg_msgIdRangeCount;
-
- inner_gv = g_variant_get_variant( arg_mdgId );
- g_variant_get(inner_gv, "aa{sv}", &iter);
-
- while (g_variant_iter_next(iter, "a{sv}", &iter_row)) {
- while (g_variant_iter_loop(iter_row, "{sv}", &key, &value)) {
- if (!g_strcmp0(key, "FromMsgId")) {
- setCbConfig.msgIDs[i].net3gpp.fromMsgId = g_variant_get_uint16(value);
- }
- if (!g_strcmp0(key, "ToMsgId")) {
- setCbConfig.msgIDs[i].net3gpp.toMsgId = g_variant_get_uint16(value);
- }
- if (!g_strcmp0(key, "CBCategory")) {
- setCbConfig.msgIDs[i].net3gpp2.cbCategory = g_variant_get_uint16(value);
- }
- if (!g_strcmp0(key, "CBLanguage")) {
- setCbConfig.msgIDs[i].net3gpp2.cbLanguage = g_variant_get_uint16(value);
- }
- if (!g_strcmp0(key, "Selected")) {
- setCbConfig.msgIDs[i].net3gpp2.selected = g_variant_get_byte(value);
- }
- }
- i++;
- g_variant_iter_free(iter_row);
- if ( i >= SMS_GSM_SMS_CBMI_LIST_SIZE_MAX )
- break;
- }
- g_variant_iter_free(iter);
-
- ur = MAKE_UR(ctx, sms, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sms_set_cb_config), &setCbConfig);
- tcore_user_request_set_command(ur, TREQ_SMS_SET_CB_CONFIG);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_sms_set_mem_status(TelephonySms *sms, GDBusMethodInvocation *invocation,
- gint arg_memoryStatus,
- gpointer user_data)
-{
- struct treq_sms_set_mem_status memStatus = {0,};
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- if (!check_access_control (invocation, AC_SMS, "w"))
- return TRUE;
-
- memStatus.memory_status = arg_memoryStatus;
-
- ur = MAKE_UR(ctx, sms, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sms_set_mem_status), &memStatus);
- tcore_user_request_set_command(ur, TREQ_SMS_SET_MEM_STATUS);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_sms_get_pref_bearer(TelephonySms *sms, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct treq_sms_get_pref_bearer getPrefBearer;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- if (!check_access_control (invocation, AC_SMS, "r"))
- return TRUE;
-
- ur = MAKE_UR(ctx, sms, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sms_get_pref_bearer), &getPrefBearer);
- tcore_user_request_set_command(ur, TREQ_SMS_GET_PREF_BEARER);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_sms_set_pref_bearer(TelephonySms *sms, GDBusMethodInvocation *invocation,
- gint arg_bearerType,
- gpointer user_data)
-{
- struct treq_sms_set_pref_bearer setPrefBearer = {0,};
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- if (!check_access_control (invocation, AC_SMS, "w"))
- return TRUE;
-
- setPrefBearer.svc = arg_bearerType;
-
- ur = MAKE_UR(ctx, sms, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sms_set_pref_bearer), &setPrefBearer);
- tcore_user_request_set_command(ur, TREQ_SMS_SET_PREF_BEARER);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_sms_set_delivery_report(TelephonySms *sms, GDBusMethodInvocation *invocation,
- GVariant *arg_sca,
- gint arg_tpdu_length,
- GVariant *arg_tpdu_data,
- gint arg_rpCause,
- gpointer user_data)
-{
- struct treq_sms_set_delivery_report deliveryReport;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- int i = 0;
- GVariantIter *iter = 0;
- GVariant *inner_gv = 0;
-
- if (!check_access_control (invocation, AC_SMS, "w"))
- return TRUE;
-
- memset(&deliveryReport, 0, sizeof(struct treq_sms_set_delivery_report));
-
- inner_gv = g_variant_get_variant( arg_sca );
- g_variant_get(inner_gv, "ay", &iter);
- while( g_variant_iter_loop(iter, "y", &deliveryReport.dataInfo.sca[i] ) ) {
- i++;
- if( i >= SMS_SMSP_ADDRESS_LEN )
- break;
- }
-
- i = 0;
- inner_gv = g_variant_get_variant( arg_tpdu_data );
- g_variant_get(inner_gv, "ay", &iter);
- while( g_variant_iter_loop(iter, "y", &deliveryReport.dataInfo.tpduData[i] ) ) {
- i++;
- if( i >= SMS_SMDATA_SIZE_MAX + 1 )
- break;
- }
-
- deliveryReport.dataInfo.msgLength = arg_tpdu_length;
-
- deliveryReport.rspType = arg_rpCause;
-
- ur = MAKE_UR(ctx, sms, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sms_set_delivery_report), &deliveryReport);
- tcore_user_request_set_command(ur, TREQ_SMS_SET_DELIVERY_REPORT);
-
- g_variant_iter_free(iter);
- g_variant_unref(inner_gv);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_sms_set_msg_status(TelephonySms *sms, GDBusMethodInvocation *invocation,
- gint arg_index,
- gint arg_msgStatus,
- gpointer user_data)
-{
- struct treq_sms_set_msg_status msgStatus = {0,};
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- if (!check_access_control (invocation, AC_SMS, "w"))
- return TRUE;
-
- msgStatus.index = arg_index;
- msgStatus.msgStatus = arg_msgStatus;
-
- ur = MAKE_UR(ctx, sms, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sms_set_msg_status), &msgStatus);
- tcore_user_request_set_command(ur, TREQ_SMS_SET_MSG_STATUS);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_sms_get_sms_params(TelephonySms *sms, GDBusMethodInvocation *invocation,
- gint arg_index,
- gpointer user_data)
-{
- struct treq_sms_get_params getParams = {0,};
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- if (!check_access_control (invocation, AC_SMS, "r"))
- return TRUE;
-
- getParams.index = arg_index;
-
- ur = MAKE_UR(ctx, sms, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sms_get_params), &getParams);
- tcore_user_request_set_command(ur, TREQ_SMS_GET_PARAMS);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_sms_set_sms_params(TelephonySms *sms, GDBusMethodInvocation *invocation,
- gint arg_recordIndex,
- gint arg_recordLen,
- gint arg_alphaIdLen,
- GVariant *arg_alphaId,
- gint arg_paramIndicator,
- gint arg_destAddr_DialNumLen,
- gint arg_destAddr_Ton,
- gint arg_destAddr_Npi,
- GVariant *arg_destAddr_DiallingNum,
- gint arg_svcCntrAddr_DialNumLen,
- gint arg_SvcCntrAddr_Ton,
- gint arg_svcCntrAddr_Npi,
- GVariant *arg_svcCntrAddr_DialNum,
- gint arg_protocolId,
- gint arg_dataCodingScheme,
- gint arg_validityPeriod,
- gpointer user_data)
-{
- struct treq_sms_set_params setParams;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- int i = 0;
- GVariantIter *iter = 0;
- GVariant *inner_gv = 0;
-
- if (!check_access_control (invocation, AC_SMS, "w"))
- return TRUE;
-
- memset(&setParams, 0, sizeof(struct treq_sms_set_params));
-
- setParams.params.recordIndex = arg_recordIndex;
- setParams.params.recordLen = arg_recordLen;
- setParams.params.alphaIdLen = arg_alphaIdLen;
-
- inner_gv = g_variant_get_variant( arg_alphaId );
- g_variant_get(inner_gv, "ay", &iter);
- while( g_variant_iter_loop(iter, "y", &setParams.params.szAlphaId[i] ) ) {
- i++;
- if( i >= SMS_SMSP_ALPHA_ID_LEN_MAX + 1 )
- break;
- }
-
- setParams.params.paramIndicator = arg_paramIndicator;
-
- setParams.params.tpDestAddr.dialNumLen = arg_destAddr_DialNumLen;
- setParams.params.tpDestAddr.typeOfNum = arg_destAddr_Ton;
- setParams.params.tpDestAddr.numPlanId = arg_destAddr_Npi;
-
- i = 0;
- inner_gv = g_variant_get_variant( arg_destAddr_DiallingNum );
- g_variant_get(inner_gv, "ay", &iter);
- while( g_variant_iter_loop(iter, "y", &setParams.params.tpDestAddr.diallingNum[i] ) ) {
- i++;
- if( i >= SMS_SMSP_ADDRESS_LEN + 1 )
- break;
- }
-
- setParams.params.tpSvcCntrAddr.dialNumLen = arg_svcCntrAddr_DialNumLen;
- setParams.params.tpSvcCntrAddr.typeOfNum = arg_SvcCntrAddr_Ton;
- setParams.params.tpSvcCntrAddr.numPlanId = arg_svcCntrAddr_Npi;
-
- i = 0;
- inner_gv = g_variant_get_variant( arg_svcCntrAddr_DialNum );
- g_variant_get(inner_gv, "ay", &iter);
- while( g_variant_iter_loop(iter, "y", &setParams.params.tpSvcCntrAddr.diallingNum[i] ) ) {
- i++;
- if( i >= SMS_SMSP_ADDRESS_LEN + 1 )
- break;
- }
-
- setParams.params.tpProtocolId = arg_protocolId;
- setParams.params.tpDataCodingScheme = arg_dataCodingScheme;
- setParams.params.tpValidityPeriod = arg_validityPeriod;
-
- ur = MAKE_UR(ctx, sms, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sms_set_params), &setParams);
- tcore_user_request_set_command(ur, TREQ_SMS_SET_PARAMS);
-
- g_variant_iter_free(iter);
- g_variant_unref(inner_gv);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_sms_get_sms_param_cnt(TelephonySms *sms, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- if (!check_access_control (invocation, AC_SMS, "r"))
- return TRUE;
-
- ur = MAKE_UR(ctx, sms, invocation);
- tcore_user_request_set_data(ur, 0, NULL);
- tcore_user_request_set_command(ur, TREQ_SMS_GET_PARAMCNT);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_sms_get_sms_ready_status(TelephonySms *sms, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- GSList *co_list = NULL;
- CoreObject *co_sms = NULL;
- TcorePlugin *plugin = NULL;
- gboolean ready_status = FALSE;
-
- plugin = tcore_server_find_plugin(ctx->server, GET_CP_NAME(invocation));
- co_list = tcore_plugin_get_core_objects_bytype(plugin, CORE_OBJECT_TYPE_SMS);
- if (!co_list) {
- dbg("error- co_list is NULL");
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- return TRUE;
- }
-
- co_sms = (CoreObject *)co_list->data;
- g_slist_free(co_list);
-
- if (!co_sms) {
- dbg("error- co_sms is NULL");
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- return TRUE;
- }
-
- ready_status = tcore_sms_get_ready_status(co_sms);
- dbg("ready_status = %d", ready_status);
- telephony_sms_complete_get_sms_ready_status(sms, invocation, ready_status);
-
- return TRUE;
-}
-
-gboolean dbus_plugin_setup_sms_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx)
-{
- TelephonySms *sms;
-
- sms = telephony_sms_skeleton_new();
- telephony_object_skeleton_set_sms(object, sms);
- g_object_unref(sms);
-
- g_signal_connect(sms,
- "handle-send-msg",
- G_CALLBACK (on_sms_send_msg),
- ctx);
-
- g_signal_connect(sms,
- "handle-read-msg",
- G_CALLBACK (on_sms_read_msg),
- ctx);
-
- g_signal_connect(sms,
- "handle-save-msg",
- G_CALLBACK (on_sms_save_msg),
- ctx);
-
- g_signal_connect(sms,
- "handle-delete-msg",
- G_CALLBACK (on_sms_delete_msg),
- ctx);
-
- g_signal_connect(sms,
- "handle-get-msg-count",
- G_CALLBACK (on_sms_get_msg_count),
- ctx);
-
- g_signal_connect(sms,
- "handle-get-sca",
- G_CALLBACK (on_sms_get_sca),
- ctx);
-
- g_signal_connect(sms,
- "handle-set-sca",
- G_CALLBACK (on_sms_set_sca),
- ctx);
-
- g_signal_connect(sms,
- "handle-get-cb-config",
- G_CALLBACK (on_sms_get_cb_config),
- ctx);
-
- g_signal_connect(sms,
- "handle-set-cb-config",
- G_CALLBACK (on_sms_set_cb_config),
- ctx);
-
- g_signal_connect(sms,
- "handle-set-mem-status",
- G_CALLBACK (on_sms_set_mem_status),
- ctx);
-
- g_signal_connect(sms,
- "handle-get-pref-bearer",
- G_CALLBACK (on_sms_get_pref_bearer),
- ctx);
-
- g_signal_connect(sms,
- "handle-set-pref-bearer",
- G_CALLBACK (on_sms_set_pref_bearer),
- ctx);
-
- g_signal_connect(sms,
- "handle-set-delivery-report",
- G_CALLBACK (on_sms_set_delivery_report),
- ctx);
-
- g_signal_connect(sms,
- "handle-set-msg-status",
- G_CALLBACK (on_sms_set_msg_status),
- ctx);
-
- g_signal_connect(sms,
- "handle-get-sms-params",
- G_CALLBACK (on_sms_get_sms_params),
- ctx);
-
- g_signal_connect(sms,
- "handle-set-sms-params",
- G_CALLBACK (on_sms_set_sms_params),
- ctx);
-
- g_signal_connect(sms,
- "handle-get-sms-param-cnt",
- G_CALLBACK (on_sms_get_sms_param_cnt),
- ctx);
-
- g_signal_connect(sms,
- "handle-get-sms-ready-status",
- G_CALLBACK (on_sms_get_sms_ready_status),
- ctx);
-
- return TRUE;
-}
-
-gboolean dbus_plugin_sms_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data)
-{
- GSList *co_list;
- CoreObject *co_sms;
- char *modem_name = NULL;
- TcorePlugin *p = NULL;
- int i;
-
- modem_name = tcore_user_request_get_modem_name(ur);
- if (!modem_name)
- return FALSE;
-
- p = tcore_server_find_plugin(ctx->server, modem_name);
- free(modem_name);
- if (!p)
- return FALSE;
-
- co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_SMS);
- if (!co_list) {
- return FALSE;
- }
-
- co_sms = (CoreObject *)co_list->data;
- g_slist_free(co_list);
-
- if (!co_sms) {
- return FALSE;
- }
-
- switch (command) {
- case TRESP_SMS_SEND_UMTS_MSG: {
- const struct tresp_sms_send_umts_msg *resp = data;
-
- dbg("receive TRESP_SMS_SEND_UMTS_MSG (result:[0x%x])", resp->result);
- telephony_sms_complete_send_msg(dbus_info->interface_object, dbus_info->invocation, resp->result);
-
- }
- break;
-
- case TRESP_SMS_SEND_CDMA_MSG: {
- const struct tresp_sms_send_cdma_msg *resp = data;
-
- dbg("receive TRESP_SMS_SEND_CDMA_MSG (result:[0x%x])", resp->result);
- }
- break;
-
- case TRESP_SMS_READ_MSG: {
- const struct tresp_sms_read_msg *resp = data;
- GVariant *sca = 0, *packet_sca = 0;
- GVariant *tpdu = 0, *packet_tpdu = 0;
- GVariantBuilder b;
-
- dbg("receive TRESP_SMS_READ_MSG (result:[0x%x])", resp->result);
- g_variant_builder_init (&b, G_VARIANT_TYPE("ay"));
-
- for( i=0; i<SMS_SMSP_ADDRESS_LEN; i++) {
- g_variant_builder_add(&b, "y", resp->dataInfo.smsData.sca[i] );
- }
- sca = g_variant_builder_end(&b);
-
- g_variant_builder_init (&b, G_VARIANT_TYPE("ay"));
-
- for( i=0; i<SMS_SMDATA_SIZE_MAX + 1; i++) {
- g_variant_builder_add(&b, "y", resp->dataInfo.smsData.tpduData[i] );
- }
- tpdu = g_variant_builder_end(&b);
-
- packet_sca = g_variant_new("v", sca);
- packet_tpdu = g_variant_new("v", tpdu);
-
- telephony_sms_complete_read_msg(dbus_info->interface_object, dbus_info->invocation,
- resp->result,
- resp->dataInfo.simIndex,
- resp->dataInfo.msgStatus,
- packet_sca,
- resp->dataInfo.smsData.msgLength,
- packet_tpdu);
- }
- break;
-
- case TRESP_SMS_SAVE_MSG: {
- const struct tresp_sms_save_msg *resp = data;
-
- dbg("receive TRESP_SMS_SAVE_MSG (result:[0x%x])", resp->result);
- telephony_sms_complete_save_msg (dbus_info->interface_object, dbus_info->invocation,
- resp->result,
- resp->index);
- }
- break;
-
- case TRESP_SMS_DELETE_MSG: {
- const struct tresp_sms_delete_msg *resp = data;
-
- dbg("receive TRESP_SMS_DELETE_MSG (result:[0x%x])", resp->result);
- telephony_sms_complete_delete_msg(dbus_info->interface_object, dbus_info->invocation,
- resp->result, resp->index);
-
- }
- break;
-
- case TRESP_SMS_GET_STORED_MSG_COUNT: {
- const struct tresp_sms_get_storedMsgCnt *resp = data;
- GVariant *list;
- GVariantBuilder b;
- unsigned int loop_var;
-
- dbg("receive TRESP_SMS_GET_STORED_MSG_COUNT (result:[0x%x])", resp->result);
- g_variant_builder_init (&b, G_VARIANT_TYPE("ai"));
-
- for (loop_var=0; loop_var<resp->storedMsgCnt.totalCount; loop_var++) {
- g_variant_builder_add(&b, "i", resp->storedMsgCnt.indexList[loop_var]);
- }
- list = g_variant_builder_end(&b);
-
- telephony_sms_complete_get_msg_count(dbus_info->interface_object, dbus_info->invocation,
- resp->result,
- resp->storedMsgCnt.totalCount,
- resp->storedMsgCnt.usedCount,
- list);
- }
- break;
-
- case TRESP_SMS_GET_SCA: {
- const struct tresp_sms_get_sca *resp = data;
- GVariant *sca = 0, *packet_sca = 0;
- GVariantBuilder b;
-
- dbg("receive TRESP_SMS_GET_SCA (result:[0x%x])", resp->result);
- g_variant_builder_init (&b, G_VARIANT_TYPE("ay"));
-
- for( i=0; i<SMS_SMSP_ADDRESS_LEN + 1; i++) {
- g_variant_builder_add(&b, "y", resp->scaAddress.diallingNum[i] );
- }
- sca = g_variant_builder_end(&b);
-
- packet_sca = g_variant_new("v", sca);
-
- telephony_sms_complete_get_sca(dbus_info->interface_object, dbus_info->invocation,
- resp->result,
- resp->scaAddress.typeOfNum,
- resp->scaAddress.numPlanId,
- resp->scaAddress.dialNumLen,
- packet_sca);
- }
- break;
-
- case TRESP_SMS_SET_SCA: {
- const struct tresp_sms_set_sca *resp = data;
-
- dbg("receive TRESP_SMS_SET_SCA (result:[0x%x])", resp->result);
- telephony_sms_complete_set_sca(dbus_info->interface_object, dbus_info->invocation,
- resp->result);
-
- }
- break;
-
- case TRESP_SMS_GET_CB_CONFIG: {
- const struct tresp_sms_get_cb_config *resp = data;
- GVariant *result = NULL;
- GVariantBuilder b;
-
- dbg("receive TRESP_SMS_GET_CB_CONFIG (result:[0x%x])", resp->result);
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for (i = 0; i < resp->cbConfig.msgIdRangeCount; i++) {
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
-
- if( resp->cbConfig.net3gppType == SMS_NETTYPE_3GPP ) {
- g_variant_builder_add(&b, "{sv}", "FromMsgId", g_variant_new_uint16(resp->cbConfig.msgIDs[i].net3gpp.fromMsgId));
- g_variant_builder_add(&b, "{sv}", "ToMsgId", g_variant_new_uint16(resp->cbConfig.msgIDs[i].net3gpp.toMsgId));
- } else if( resp->cbConfig.net3gppType == SMS_NETTYPE_3GPP2) {
- g_variant_builder_add(&b, "{sv}", "CBCategory", g_variant_new_uint16(resp->cbConfig.msgIDs[i].net3gpp2.cbCategory));
- g_variant_builder_add(&b, "{sv}", "CBLanguage", g_variant_new_uint16(resp->cbConfig.msgIDs[i].net3gpp2.cbLanguage));
- } else {
- dbg("Unknown 3gpp type");
- return FALSE;
- }
-
- g_variant_builder_add(&b, "{sv}", "Selected", g_variant_new_byte(resp->cbConfig.msgIDs[i].net3gpp.selected));
-
- g_variant_builder_close(&b);
- }
-
- result = g_variant_builder_end(&b);
-
- telephony_sms_complete_get_cb_config(dbus_info->interface_object, dbus_info->invocation,
- resp->result,
- resp->cbConfig.net3gppType,
- resp->cbConfig.cbEnabled,
- resp->cbConfig.msgIdMaxCount,
- resp->cbConfig.msgIdRangeCount,
- result);
- }
- break;
-
- case TRESP_SMS_SET_CB_CONFIG: {
- const struct tresp_sms_set_cb_config *resp = data;
-
- dbg("receive TRESP_SMS_SET_CB_CONFIG (result:[0x%x])", resp->result);
- telephony_sms_complete_set_cb_config(dbus_info->interface_object, dbus_info->invocation,
- resp->result);
-
- }
- break;
-
- case TRESP_SMS_SET_MEM_STATUS: {
- const struct tresp_sms_set_mem_status *resp = data;
-
- dbg("receive TRESP_SMS_SET_MEM_STATUS (result:[0x%x])", resp->result);
- telephony_sms_complete_set_mem_status(dbus_info->interface_object, dbus_info->invocation,
- resp->result);
-
- }
- break;
- case TRESP_SMS_GET_PREF_BEARER: {
- const struct tresp_sms_get_pref_bearer *resp = data;
-
- dbg("receive TRESP_SMS_GET_PREF_BEARER (result:[0x%x])", resp->result);
- telephony_sms_complete_get_pref_bearer(dbus_info->interface_object, dbus_info->invocation,
- resp->result);
-
- }
- break;
-
- case TRESP_SMS_SET_PREF_BEARER: {
- const struct tresp_sms_set_pref_bearer *resp = data;
-
- dbg("receive TRESP_SMS_SET_PREF_BEARER (result:[0x%x])", resp->result);
- telephony_sms_complete_set_pref_bearer(dbus_info->interface_object, dbus_info->invocation,
- resp->result);
-
- }
- break;
-
- case TRESP_SMS_SET_DELIVERY_REPORT: {
- const struct tresp_sms_set_delivery_report *resp = data;
-
- dbg("receive TRESP_SMS_SET_DELIVERY_REPORT (result:[0x%x])", resp->result);
- telephony_sms_complete_set_delivery_report(dbus_info->interface_object, dbus_info->invocation,
- resp->result);
-
- }
- break;
-
- case TRESP_SMS_SET_MSG_STATUS: {
- const struct tresp_sms_set_mem_status *resp = data;
-
- dbg("receive TRESP_SMS_SET_MSG_STATUS (result:[0x%x])", resp->result);
- telephony_sms_complete_set_msg_status(dbus_info->interface_object, dbus_info->invocation,
- resp->result);
-
- }
- break;
-
- case TRESP_SMS_GET_PARAMS: {
- const struct tresp_sms_get_params *resp = data;
- GVariant *alphaId = 0, *packet_alphaId = 0;
- GVariant *destDialNum = 0, *packet_destDialNum = 0;
- GVariant *scaDialNum = 0, *packet_scaDialNum = 0;
- GVariantBuilder b;
-
- dbg("receive TRESP_SMS_GET_PARAMS (result:[0x%x])", resp->result);
- g_variant_builder_init(&b, G_VARIANT_TYPE("ay"));
- for( i=0; i<SMS_SMSP_ALPHA_ID_LEN_MAX + 1; i++) {
- g_variant_builder_add(&b, "y", resp->paramsInfo.szAlphaId[i] );
- }
- alphaId = g_variant_builder_end(&b);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("ay"));
- for( i=0; i<SMS_SMSP_ADDRESS_LEN + 1; i++) {
- g_variant_builder_add(&b, "y", resp->paramsInfo.tpDestAddr.diallingNum[i] );
- }
- destDialNum = g_variant_builder_end(&b);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("ay"));
- for( i=0; i<SMS_SMSP_ADDRESS_LEN + 1; i++) {
- g_variant_builder_add(&b, "y", resp->paramsInfo.tpSvcCntrAddr.diallingNum[i] );
- }
- scaDialNum = g_variant_builder_end(&b);
-
- packet_alphaId = g_variant_new("v", alphaId);
- packet_destDialNum = g_variant_new("v", destDialNum);
- packet_scaDialNum = g_variant_new("v", scaDialNum);
-
- telephony_sms_complete_get_sms_params(dbus_info->interface_object, dbus_info->invocation,
- resp->result,
- resp->paramsInfo.recordIndex,
- resp->paramsInfo.recordLen,
- resp->paramsInfo.alphaIdLen,
- packet_alphaId,
- resp->paramsInfo.paramIndicator,
- resp->paramsInfo.tpDestAddr.dialNumLen,
- resp->paramsInfo.tpDestAddr.typeOfNum,
- resp->paramsInfo.tpDestAddr.numPlanId,
- packet_destDialNum,
- resp->paramsInfo.tpSvcCntrAddr.dialNumLen,
- resp->paramsInfo.tpSvcCntrAddr.typeOfNum,
- resp->paramsInfo.tpSvcCntrAddr.numPlanId,
- packet_scaDialNum,
- resp->paramsInfo.tpProtocolId,
- resp->paramsInfo.tpDataCodingScheme,
- resp->paramsInfo.tpValidityPeriod);
- }
- break;
-
- case TRESP_SMS_SET_PARAMS:{
- const struct tresp_sms_set_params *resp = data;
-
- dbg("receive TRESP_SMS_SET_PARAMS (result:[0x%x])", resp->result);
- telephony_sms_complete_set_sms_params(dbus_info->interface_object, dbus_info->invocation,
- resp->result);
-
- }
- break;
-
- case TRESP_SMS_GET_PARAMCNT: {
- const struct tresp_sms_get_paramcnt *resp = data;
-
- dbg("receive TRESP_SMS_GET_PARAMCNT (result:[0x%x])", resp->result);
- telephony_sms_complete_get_sms_param_cnt(dbus_info->interface_object, dbus_info->invocation,
- resp->result,
- resp->recordCount);
-
- }
- break;
-
- default:
- break;
- }
-
- return TRUE;
-}
-
-gboolean dbus_plugin_sms_notification(struct custom_data *ctx, CoreObject *source, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data)
-{
- TelephonySms *sms;
- const char *cp_name;
-
- cp_name = tcore_server_get_cp_name_by_plugin(tcore_object_ref_plugin(source));
-
- sms = telephony_object_peek_sms(TELEPHONY_OBJECT(object));
-
- switch (command) {
- case TNOTI_SMS_INCOM_MSG: {
- const struct tnoti_sms_umts_msg *noti = data;
-
- GVariant *sca = 0, *packet_sca = 0;
- GVariant *tpdu = 0, *packet_tpdu = 0;
- GVariantBuilder b;
- unsigned int i;
-
- info("[DBUSINFO][%s] SMS_INCOM_MSG (len[%d])", cp_name, data_len);
-
- g_variant_builder_init (&b, G_VARIANT_TYPE("ay"));
- for( i=0; i<SMS_SMSP_ADDRESS_LEN; i++) {
- g_variant_builder_add(&b, "y", noti->msgInfo.sca[i] );
- }
- sca = g_variant_builder_end(&b);
-
- g_variant_builder_init (&b, G_VARIANT_TYPE("ay"));
- for( i=0; i<SMS_SMDATA_SIZE_MAX + 1; i++) {
- g_variant_builder_add(&b, "y", noti->msgInfo.tpduData[i] );
- }
- tpdu = g_variant_builder_end(&b);
-
- packet_sca = g_variant_new("v", sca);
- packet_tpdu = g_variant_new("v", tpdu);
-
- telephony_sms_emit_incomming_msg(sms,
- packet_sca,
- noti->msgInfo.msgLength,
- packet_tpdu);
- }
- break;
-
- case TNOTI_SMS_CB_INCOM_MSG: {
- const struct tnoti_sms_cellBroadcast_msg *noti = data;
- GVariant *msgData = 0, *packet_msgData = 0;
- GVariantBuilder b;
- int i;
-
- info("[DBUSINFO][%s] SMS_CB_INCOM_MSG (len[%d])", cp_name, data_len);
-
- g_variant_builder_init (&b, G_VARIANT_TYPE("ay"));
-
- for( i=0; i < (int)noti->cbMsg.length + 1; i++) {
- g_variant_builder_add(&b, "y", noti->cbMsg.msgData[i] );
- }
- msgData = g_variant_builder_end(&b);
- packet_msgData = g_variant_new("v", msgData);
-
- telephony_sms_emit_incomming_cb_msg(sms,
- noti->cbMsg.cbMsgType,
- noti->cbMsg.length,
- packet_msgData);
- }
- break;
-
- case TNOTI_SMS_ETWS_INCOM_MSG: {
- const struct tnoti_sms_etws_msg *noti = data;
- GVariant *msgData = 0, *packet_msgData = 0;
- GVariantBuilder b;
- unsigned int i;
-
- info("[DBUSINFO][%s] ETWS_INCOM_MSG (len[%d])", cp_name, data_len);
-
- g_variant_builder_init (&b, G_VARIANT_TYPE("ay"));
-
- for( i=0; i<SMS_ETWS_SIZE_MAX + 1; i++) {
- g_variant_builder_add(&b, "y", noti->etwsMsg.msgData[i] );
- }
- msgData = g_variant_builder_end(&b);
- packet_msgData = g_variant_new("v", msgData);
-
- telephony_sms_emit_incomming_etws_msg(sms,
- noti->etwsMsg.etwsMsgType,
- noti->etwsMsg.length,
- packet_msgData);
- }
- break;
-
- case TNOTI_SMS_INCOM_EX_MSG: {
- info("[DBUSINFO][%s] SMS_INCOM_EX_MSG (len[%d])", cp_name, data_len);
- }
- break;
-
- case TNOTI_SMS_CB_INCOM_EX_MSG: {
- info("[DBUSINFO][%s] CB_INCOM_EX_MSG (len[%d])", cp_name, data_len);
- }
- break;
-
- case TNOTI_SMS_MEMORY_STATUS: {
- const struct tnoti_sms_memory_status *noti = data;
- info("[DBUSINFO][%s] SMS_MEMORY_STATUS (%d)", cp_name, noti->status);
- telephony_sms_emit_memory_status(sms, noti->status);
- }
- break;
-
- case TNOTI_SMS_DEVICE_READY: {
- const struct tnoti_sms_ready_status *noti = data;
- info("[DBUSINFO][%s] SMS_DEVICE_READY (%d)", cp_name, noti->status);
-#ifdef ENABLE_KPI_LOGS
- if (noti->status == TRUE)
- TIME_CHECK("[%s] SMS Service Ready", cp_name);
-#endif
- telephony_sms_emit_sms_ready(sms, noti->status);
-
- }
- break;
-
- default:
- dbg("unknown notification");
- return FALSE;
- break;
- }
-
- return TRUE;
-}
+++ /dev/null
-/*
- * tel-plugin-dbus-tapi
- *
- * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Ja-young Gu <jygu@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <pthread.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <time.h>
-#include <glib.h>
-#include <gio/gio.h>
-
-#include <appsvc.h>
-#include <bundle.h>
-
-#include <tcore.h>
-#include <server.h>
-#include <plugin.h>
-#include <hal.h>
-#include <communicator.h>
-#include <storage.h>
-#include <queue.h>
-#include <user_request.h>
-#include <co_ss.h>
-#include <co_sim.h>
-#include <co_ps.h>
-
-#include "generated-code.h"
-#include "common.h"
-
-struct ciss_data_type {
- int status;
- int dcs;
- int length;
- char data[MAX_SS_USSD_LEN];
-};
-
-struct ciss_information {
- int err;
- int ss_type;
-};
-
-static void _launch_ciss_information(const struct tnoti_ss_information *info)
-{
- gchar *encoded_data;
- struct ciss_information ciss_inform;
-
- bundle *kb = NULL;
-
- memset(&ciss_inform, 0, sizeof(struct ciss_information));
- ciss_inform.err = info->err;
- ciss_inform.ss_type = info->ss_type;
-
- dbg("Explicit launch ciss application by appsvc");
-
- kb = bundle_create();
- if (!kb) {
- warn("bundle_create() failed");
- return;
- }
-
- appsvc_set_pkgname(kb, "org.tizen.ciss");
-
- encoded_data = g_base64_encode((guchar *)&ciss_inform, sizeof(struct ciss_information));
-
- appsvc_add_data(kb, "CISS_LAUNCHING_MODE", "RESP");
- appsvc_add_data(kb, "KEY_EVENT_TYPE", "200");
- appsvc_add_data(kb, "KEY_ENCODED_DATA", encoded_data);
-
- dbg("ciss appsvc run");
- appsvc_run_service(kb, 0, NULL, NULL);
-
- bundle_free(kb);
- g_free(encoded_data);
-
- return;
-}
-
-
-static void _launch_ciss(const struct tnoti_ss_ussd *ussd, enum dbus_tapi_sim_slot_id slot_id)
-{
- gchar *encoded_data;
- struct ciss_data_type ciss_data;
- char slot_info[2] = {0,};
-
- bundle *kb = NULL;
-
- memset(&ciss_data, 0, sizeof(struct ciss_data_type));
- ciss_data.status = ussd->dcs;
- ciss_data.status = ussd->status;
- ciss_data.length = ussd->len;
- memcpy(ciss_data.data, ussd->str, ciss_data.length);
-
- snprintf(slot_info, 2, "%d", slot_id);
- dbg("slot_id : [%s]", slot_info);
-
- dbg("Explicit launch ciss application by appsvc");
-
- kb = bundle_create();
- if (!kb) {
- warn("bundle_create() failed");
- return;
- }
-
-
- appsvc_set_pkgname(kb, "org.tizen.ciss");
-
- encoded_data = g_base64_encode((guchar *)&ciss_data, sizeof(struct ciss_data_type));
-
- appsvc_add_data(kb, "CISS_LAUNCHING_MODE", "RESP");
- appsvc_add_data(kb, "KEY_EVENT_TYPE", "100");
- appsvc_add_data(kb, "KEY_ENCODED_DATA", encoded_data);
- appsvc_add_data(kb, "KEY_SLOT_ID", slot_info);
-
- dbg("ciss appsvc run");
- appsvc_run_service(kb, 0, NULL, NULL);
-
- bundle_free(kb);
- g_free(encoded_data);
-
- return;
-}
-
-static gboolean
-on_ss_activate_barring (TelephonySs *ss,
- GDBusMethodInvocation *invocation,
- gint ss_class,
- gint barring_mode,
- const gchar *barring_password,
- gpointer user_data)
-{
- char buf[5];
- struct treq_ss_barring req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- int ret = 0;
-
- memset(&req, 0, sizeof(struct treq_ss_barring));
-
- req.class = ss_class;
- req.mode = barring_mode;
-
- memcpy(req.password, barring_password, MAX_SS_BARRING_PASSWORD_LEN);
- memcpy(buf, barring_password, MAX_SS_BARRING_PASSWORD_LEN);
-
- buf[4] = 0;
- dbg("req.password = [%s]", buf);
-
- dbg("class = %d, mode = %d", req.class, req.mode);
-
- ur = MAKE_UR(ctx, ss, invocation);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_ss_barring), &req);
- tcore_user_request_set_command(ur, TREQ_SS_BARRING_ACTIVATE);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_ss_deactivate_barring (TelephonySs *ss,
- GDBusMethodInvocation *invocation,
- gint ss_class,
- gint barring_mode,
- const gchar *barring_password,
- gpointer user_data)
-{
- char buf[5];
- struct treq_ss_barring req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- int ret = 0;
-
- memset(&req, 0, sizeof(struct treq_ss_barring));
-
- req.class = ss_class;
- req.mode = barring_mode;
-
- memcpy(req.password, barring_password, MAX_SS_BARRING_PASSWORD_LEN);
- memcpy(buf, barring_password, MAX_SS_BARRING_PASSWORD_LEN);
-
- buf[4] = 0;
- dbg("req.password = [%s]", buf);
- dbg("class = %d, mode = %d", req.class, req.mode);
-
- ur = MAKE_UR(ctx, ss, invocation);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_ss_barring), &req);
- tcore_user_request_set_command(ur, TREQ_SS_BARRING_DEACTIVATE);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_ss_change_barring_password (TelephonySs *ss,
- GDBusMethodInvocation *invocation,
- const gchar *barring_password,
- const gchar *barring_password_new,
- const gchar *barring_password_confirm,
- gpointer user_data)
-{
- char buf[5];
- struct treq_ss_barring_change_password req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- int ret = 0;
-
- memset(&req, 0, sizeof(struct treq_ss_barring_change_password));
-
- memcpy(req.password_old, barring_password, MAX_SS_BARRING_PASSWORD_LEN);
- memcpy(req.password_new, barring_password_new, MAX_SS_BARRING_PASSWORD_LEN);
- memcpy(req.password_confirm, barring_password_confirm, MAX_SS_BARRING_PASSWORD_LEN);
-
- memcpy(buf, barring_password, MAX_SS_BARRING_PASSWORD_LEN);
- buf[4] = 0;
-
- memcpy(buf, barring_password_new, MAX_SS_BARRING_PASSWORD_LEN);
-
- memcpy(buf, barring_password_confirm, MAX_SS_BARRING_PASSWORD_LEN);
-
- ur = MAKE_UR(ctx, ss, invocation);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_ss_barring_change_password), &req);
- tcore_user_request_set_command(ur, TREQ_SS_BARRING_CHANGE_PASSWORD);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_ss_get_barring_status (TelephonySs *ss,
- GDBusMethodInvocation *invocation,
- gint ss_class,
- gint barring_mode,
- gpointer user_data)
-{
- struct treq_ss_barring req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- int ret = 0;
-
- memset(&req, 0, sizeof(struct treq_ss_barring));
-
- req.class = ss_class;
- req.mode = barring_mode;
-
- dbg("class = %d, mode = %d", req.class, req.mode);
-
- ur = MAKE_UR(ctx, ss, invocation);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_ss_barring), &req);
- tcore_user_request_set_command(ur, TREQ_SS_BARRING_GET_STATUS);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_ss_register_forwarding (TelephonySs *ss,
- GDBusMethodInvocation *invocation,
- gint ss_class,
- gint forward_mode,
- gint forward_no_reply_time,
- gint forward_ton,
- gint forward_npi,
- const gchar *forward_number,
- gpointer user_data)
-{
- struct treq_ss_forwarding req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- int ret = 0;
-
- if (!check_access_control (invocation, AC_SS, "w")) {
- GVariant *result = 0;
- GVariantBuilder b;
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_register_forwarding(ss, invocation, result, ret);
-
- return TRUE;
- }
-
- memset(&req, 0, sizeof(struct treq_ss_forwarding));
-
- req.class = ss_class;
- req.mode = forward_mode;
- req.time = forward_no_reply_time;
- req.ton = forward_ton;
- req.npi = forward_npi;
- snprintf(req.number, MAX_SS_FORWARDING_NUMBER_LEN, "%s", forward_number);
-
- dbg("class = %d, mode = %d, time = %d, number = %s",
- req.class, req.mode, req.time, req.number);
-
- ur = MAKE_UR(ctx, ss, invocation);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_ss_forwarding), &req);
- tcore_user_request_set_command(ur, TREQ_SS_FORWARDING_REGISTER);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_ss_deregister_forwarding (TelephonySs *ss,
- GDBusMethodInvocation *invocation,
- gint ss_class,
- gint forward_mode,
- gint forward_no_reply_time,
- gint forward_ton,
- gint forward_npi,
- const gchar *forward_number,
- gpointer user_data)
-{
- struct treq_ss_forwarding req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- int ret = 0;
-
- if (!check_access_control (invocation, AC_SS, "w")) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- memset(&req, 0, sizeof(struct treq_ss_forwarding));
-
- req.class = ss_class;
- req.mode = forward_mode;
- req.time = forward_no_reply_time;
- req.ton = forward_ton;
- req.npi = forward_npi;
- snprintf(req.number, MAX_SS_FORWARDING_NUMBER_LEN, "%s", forward_number);
-
- dbg("class = %d, mode = %d, time = %d, number = %s",
- req.class, req.mode, req.time, req.number);
-
- ur = MAKE_UR(ctx, ss, invocation);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_ss_forwarding), &req);
- tcore_user_request_set_command(ur, TREQ_SS_FORWARDING_DEREGISTER);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_ss_activate_forwarding (TelephonySs *ss,
- GDBusMethodInvocation *invocation,
- gint ss_class,
- gint forward_mode,
- gint forward_no_reply_time,
- gint forward_ton,
- gint forward_npi,
- const gchar *forward_number,
- gpointer user_data)
-{
- struct treq_ss_forwarding req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- int ret = 0;
-
- if (!check_access_control (invocation, AC_SS, "w")) {
- GVariant *result = 0;
- GVariantBuilder b;
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_activate_forwarding(ss, invocation, result, ret);
-
- return TRUE;
- }
-
- memset(&req, 0, sizeof(struct treq_ss_forwarding));
-
- req.class = ss_class;
- req.mode = forward_mode;
- req.time = forward_no_reply_time;
- req.ton = forward_ton;
- req.npi = forward_npi;
- snprintf(req.number, MAX_SS_FORWARDING_NUMBER_LEN, "%s", forward_number);
-
- dbg("class = %d, mode = %d, time = %d, number = %s",
- req.class, req.mode, req.time, req.number);
-
- ur = MAKE_UR(ctx, ss, invocation);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_ss_forwarding), &req);
- tcore_user_request_set_command(ur, TREQ_SS_FORWARDING_ACTIVATE);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_ss_deactivate_forwarding (TelephonySs *ss,
- GDBusMethodInvocation *invocation,
- gint ss_class,
- gint forward_mode,
- gint forward_no_reply_time,
- gint forward_ton,
- gint forward_npi,
- const gchar *forward_number,
- gpointer user_data)
-{
- struct treq_ss_forwarding req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- int ret = 0;
-
- if (!check_access_control (invocation, AC_SS, "w")) {
- GVariant *result = 0;
- GVariantBuilder b;
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_deactivate_forwarding(ss, invocation, result, ret);
-
- return TRUE;
- }
-
- memset(&req, 0, sizeof(struct treq_ss_forwarding));
-
- req.class = ss_class;
- req.mode = forward_mode;
- req.time = forward_no_reply_time;
- req.ton = forward_ton;
- req.npi = forward_npi;
- snprintf(req.number, MAX_SS_FORWARDING_NUMBER_LEN, "%s", forward_number);
-
- dbg("class = %d, mode = %d, time = %d, number = %s",
- req.class, req.mode, req.time, req.number);
-
- ur = MAKE_UR(ctx, ss, invocation);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_ss_forwarding), &req);
- tcore_user_request_set_command(ur, TREQ_SS_FORWARDING_DEACTIVATE);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_ss_get_forwarding_status (TelephonySs *ss,
- GDBusMethodInvocation *invocation,
- gint ss_class,
- gint forward_mode,
- gpointer user_data)
-{
- struct treq_ss_forwarding req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- int ret = 0;
-
- if (!check_access_control (invocation, AC_SS, "r")) {
- GVariant *result = 0;
- GVariantBuilder b;
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_get_forwarding_status(ss, invocation, result, ret);
-
- return TRUE;
- }
-
- memset(&req, 0, sizeof(struct treq_ss_forwarding));
-
- req.class = ss_class;
- req.mode = forward_mode;
-
- dbg("class = %d, mode = %d, time = %d, number = %s",
- req.class, req.mode, req.time, req.number);
-
- ur = MAKE_UR(ctx, ss, invocation);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_ss_forwarding), &req);
- tcore_user_request_set_command(ur, TREQ_SS_FORWARDING_GET_STATUS);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_ss_activate_waiting (TelephonySs *ss,
- GDBusMethodInvocation *invocation,
- gint ss_class,
- gpointer user_data)
-{
- struct treq_ss_waiting req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- int ret = 0;
-
- memset(&req, 0, sizeof(struct treq_ss_waiting));
-
- req.class = ss_class;
-
- dbg("class = %d", req.class);
-
- ur = MAKE_UR(ctx, ss, invocation);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_ss_waiting), &req);
- tcore_user_request_set_command(ur, TREQ_SS_WAITING_ACTIVATE);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_ss_deactivate_waiting (TelephonySs *ss,
- GDBusMethodInvocation *invocation,
- gint ss_class,
- gpointer user_data)
-{
- struct treq_ss_waiting req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- int ret = 0;
-
- memset(&req, 0, sizeof(struct treq_ss_waiting));
-
- req.class = ss_class;
-
- dbg("class = %d", req.class);
-
- ur = MAKE_UR(ctx, ss, invocation);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_ss_waiting), &req);
- tcore_user_request_set_command(ur, TREQ_SS_WAITING_DEACTIVATE);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_ss_get_waiting_status (TelephonySs *ss,
- GDBusMethodInvocation *invocation,
- gint ss_class,
- gpointer user_data)
-{
- struct treq_ss_waiting req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- int ret = 0;
-
- memset(&req, 0, sizeof(struct treq_ss_waiting));
-
- req.class = ss_class;
-
- dbg("class = %d", req.class);
-
- ur = MAKE_UR(ctx, ss, invocation);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_ss_waiting), &req);
- tcore_user_request_set_command(ur, TREQ_SS_WAITING_GET_STATUS);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_ss_set_cli_status (TelephonySs *ss,
- GDBusMethodInvocation *invocation,
- gint cli_type,
- gint cli_status,
- gpointer user_data)
-{
- struct treq_ss_set_cli req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- int ret = 0;
-
- memset(&req, 0, sizeof(struct treq_ss_set_cli));
-
- req.type = cli_type;
- req.status = cli_status;
-
- dbg("type = %d, status = %d", req.type, req.status);
-
- ur = MAKE_UR(ctx, ss, invocation);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_ss_set_cli), &req);
- tcore_user_request_set_command(ur, TREQ_SS_CLI_SET_STATUS);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-
-static gboolean
-on_ss_get_cli_status (TelephonySs *ss,
- GDBusMethodInvocation *invocation,
- gint cli_type,
- gpointer user_data)
-{
- struct treq_ss_cli req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- int ret = 0;
-
- memset(&req, 0, sizeof(struct treq_ss_cli));
-
- req.type = cli_type;
-
- dbg("type = %d", req.type);
-
- ur = MAKE_UR(ctx, ss, invocation);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_ss_cli), &req);
- tcore_user_request_set_command(ur, TREQ_SS_CLI_GET_STATUS);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_ss_send_ussd (TelephonySs *ss,
- GDBusMethodInvocation *invocation,
- gint ussd_type,
- gint ussd_dcs,
- gint ussd_len,
- const gchar *ussd_string,
- gpointer user_data)
-{
- struct treq_ss_ussd req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- int ret = 0;
-
- memset(&req, 0, sizeof(struct treq_ss_ussd));
-
- req.type = ussd_type;
- req.dcs = (unsigned char)ussd_dcs;
- req.len = (unsigned short)ussd_len;
-
- snprintf((char*)req.str, MAX_SS_USSD_LEN, "%s", ussd_string);
-
- dbg("[ check ] type = %d, dcs = %d, len = %d, string = %s", req.type, req.dcs, req.len, req.str);
-
- ur = MAKE_UR(ctx, ss, invocation);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_ss_ussd), &req);
- tcore_user_request_set_command(ur, TREQ_SS_SEND_USSD);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS ) {
- FAIL_RESPONSE (invocation, DEFAULT_MSG_REQ_FAILED);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-gboolean dbus_plugin_setup_ss_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx)
-{
- TelephonySs *ss;
-
- ss = telephony_ss_skeleton_new();
- telephony_object_skeleton_set_ss(object, ss);
- g_object_unref(ss);
-
- g_signal_connect (ss,
- "handle-activate-barring",
- G_CALLBACK (on_ss_activate_barring),
- ctx);
-
- g_signal_connect (ss,
- "handle-deactivate-barring",
- G_CALLBACK (on_ss_deactivate_barring),
- ctx);
-
- g_signal_connect (ss,
- "handle-change-barring-password",
- G_CALLBACK (on_ss_change_barring_password),
- ctx);
-
- g_signal_connect (ss,
- "handle-get-barring-status",
- G_CALLBACK (on_ss_get_barring_status),
- ctx);
-
- g_signal_connect (ss,
- "handle-register-forwarding",
- G_CALLBACK (on_ss_register_forwarding),
- ctx);
-
- g_signal_connect (ss,
- "handle-deregister-forwarding",
- G_CALLBACK (on_ss_deregister_forwarding),
- ctx);
-
- g_signal_connect (ss,
- "handle-activate-forwarding",
- G_CALLBACK (on_ss_activate_forwarding),
- ctx);
-
- g_signal_connect (ss,
- "handle-deactivate-forwarding",
- G_CALLBACK (on_ss_deactivate_forwarding),
- ctx);
-
- g_signal_connect (ss,
- "handle-get-forwarding-status",
- G_CALLBACK (on_ss_get_forwarding_status),
- ctx);
-
- g_signal_connect (ss,
- "handle-activate-waiting",
- G_CALLBACK (on_ss_activate_waiting),
- ctx);
-
- g_signal_connect (ss,
- "handle-deactivate-waiting",
- G_CALLBACK (on_ss_deactivate_waiting),
- ctx);
-
- g_signal_connect (ss,
- "handle-get-waiting-status",
- G_CALLBACK (on_ss_get_waiting_status),
- ctx);
-
- g_signal_connect (ss,
- "handle-set-clistatus",
- G_CALLBACK (on_ss_set_cli_status),
- ctx);
-
- g_signal_connect (ss,
- "handle-get-clistatus",
- G_CALLBACK (on_ss_get_cli_status),
- ctx);
-
- g_signal_connect (ss,
- "handle-send-ussd",
- G_CALLBACK (on_ss_send_ussd),
- ctx);
-
- return TRUE;
-}
-
-gboolean dbus_plugin_ss_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data)
-{
- GVariant *result = 0;
- GVariantBuilder b;
- int i = 0;
-
- if ( !data ) {
- err("response data : 0");
- return FALSE;
- }
-
- switch (command) {
- case TRESP_SS_BARRING_ACTIVATE: {
-
- const struct tresp_ss_barring *resp = data;
-
- dbg("receive TRESP_SS_BARRING_ACTIVATE (err[%d])", resp->err);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for (i=0; i<resp->record_num; i++) {
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( resp->record[i].class ));
- g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( resp->record[i].status ));
- g_variant_builder_add(&b, "{sv}", "barring_mode", g_variant_new_int32( resp->record[i].mode ));
- g_variant_builder_close(&b);
- }
-
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_activate_barring(dbus_info->interface_object, dbus_info->invocation, result, resp->err);
-
- } break;
-
- case TRESP_SS_BARRING_DEACTIVATE: {
-
- const struct tresp_ss_barring *resp = data;
-
- dbg("receive TRESP_SS_BARRING_DEACTIVATE (err[%d])", resp->err);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for (i=0; i<resp->record_num; i++) {
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( resp->record[i].class ));
- g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( resp->record[i].status ));
- g_variant_builder_add(&b, "{sv}", "barring_mode", g_variant_new_int32( resp->record[i].mode ));
- g_variant_builder_close(&b);
- }
-
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_deactivate_barring(dbus_info->interface_object, dbus_info->invocation, result, resp->err);
-
- } break;
-
- case TRESP_SS_BARRING_CHANGE_PASSWORD: {
-
- const struct tresp_ss_general *resp = data;
-
- dbg("receive TRESP_SS_BARRING_CHANGE_PASSWORD (err[%d])", resp->err);
-
- telephony_ss_complete_change_barring_password(dbus_info->interface_object, dbus_info->invocation, resp->err);
-
- } break;
-
- case TRESP_SS_BARRING_GET_STATUS: {
-
- const struct tresp_ss_barring *resp = data;
-
- dbg("receive TRESP_SS_BARRING_GET_STATUS (err[%d])", resp->err);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for (i=0; i<resp->record_num; i++) {
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( resp->record[i].class ));
- g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( resp->record[i].status ));
- g_variant_builder_add(&b, "{sv}", "barring_mode", g_variant_new_int32( resp->record[i].mode ));
- g_variant_builder_close(&b);
- }
-
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_get_barring_status(dbus_info->interface_object, dbus_info->invocation, result, resp->err);
-
- } break;
-
- case TRESP_SS_FORWARDING_ACTIVATE: {
- const struct tresp_ss_forwarding *resp = data;
-
- dbg("receive TRESP_SS_FORWARDING_ACTIVATE (err[%d])", resp->err);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for (i=0; i<resp->record_num; i++) {
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( resp->record[i].class ));
- g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( resp->record[i].status ));
- g_variant_builder_add(&b, "{sv}", "forwarding_mode", g_variant_new_int32( resp->record[i].mode ));
- g_variant_builder_add(&b, "{sv}", "number_present", g_variant_new_int32( resp->record[i].number_present ));
- g_variant_builder_add(&b, "{sv}", "no_reply_time", g_variant_new_int32( resp->record[i].time ));
- g_variant_builder_add(&b, "{sv}", "type_of_number", g_variant_new_int32( resp->record[i].ton ));
- g_variant_builder_add(&b, "{sv}", "numbering_plan_identity", g_variant_new_int32( resp->record[i].npi ));
- g_variant_builder_add(&b, "{sv}", "forwarding_number", g_variant_new_string( resp->record[i].number ));
- g_variant_builder_close(&b);
- }
-
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_activate_forwarding(dbus_info->interface_object, dbus_info->invocation, result, resp->err);
-
- } break;
-
- case TRESP_SS_FORWARDING_DEACTIVATE: {
-
- const struct tresp_ss_forwarding *resp = data;
-
- dbg("receive TRESP_SS_FORWARDING_DEACTIVATE (err[%d])", resp->err);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for (i=0; i<resp->record_num; i++) {
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( resp->record[i].class ));
- g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( resp->record[i].status ));
- g_variant_builder_add(&b, "{sv}", "forwarding_mode", g_variant_new_int32( resp->record[i].mode ));
- g_variant_builder_add(&b, "{sv}", "number_present", g_variant_new_int32( resp->record[i].number_present ));
- g_variant_builder_add(&b, "{sv}", "no_reply_time", g_variant_new_int32( resp->record[i].time ));
- g_variant_builder_add(&b, "{sv}", "type_of_number", g_variant_new_int32( resp->record[i].ton ));
- g_variant_builder_add(&b, "{sv}", "numbering_plan_identity", g_variant_new_int32( resp->record[i].npi ));
- g_variant_builder_add(&b, "{sv}", "forwarding_number", g_variant_new_string( resp->record[i].number ));
- g_variant_builder_close(&b);
- }
-
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_deactivate_forwarding(dbus_info->interface_object, dbus_info->invocation, result, resp->err);
-
- } break;
-
- case TRESP_SS_FORWARDING_REGISTER: {
-
- const struct tresp_ss_forwarding *resp = data;
-
- dbg("receive TRESP_SS_FORWARDING_REGISTER (err[%d])", resp->err);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for (i=0; i<resp->record_num; i++) {
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( resp->record[i].class ));
- g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( resp->record[i].status ));
- g_variant_builder_add(&b, "{sv}", "forwarding_mode", g_variant_new_int32( resp->record[i].mode ));
- g_variant_builder_add(&b, "{sv}", "number_present", g_variant_new_int32( resp->record[i].number_present ));
- g_variant_builder_add(&b, "{sv}", "no_reply_time", g_variant_new_int32( resp->record[i].time ));
- g_variant_builder_add(&b, "{sv}", "type_of_number", g_variant_new_int32( resp->record[i].ton ));
- g_variant_builder_add(&b, "{sv}", "numbering_plan_identity", g_variant_new_int32( resp->record[i].npi ));
- g_variant_builder_add(&b, "{sv}", "forwarding_number", g_variant_new_string( resp->record[i].number ));
- g_variant_builder_close(&b);
- }
-
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_register_forwarding(dbus_info->interface_object, dbus_info->invocation, result, resp->err);
-
- } break;
-
- case TRESP_SS_FORWARDING_DEREGISTER: {
-
- const struct tresp_ss_forwarding *resp = data;
-
- dbg("receive TRESP_SS_FORWARDING_DEREGISTER (err[%d])", resp->err);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for (i=0; i<resp->record_num; i++) {
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( resp->record[i].class ));
- g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( resp->record[i].status ));
- g_variant_builder_add(&b, "{sv}", "forwarding_mode", g_variant_new_int32( resp->record[i].mode ));
- g_variant_builder_add(&b, "{sv}", "number_present", g_variant_new_int32( resp->record[i].number_present ));
- g_variant_builder_add(&b, "{sv}", "no_reply_time", g_variant_new_int32( resp->record[i].time ));
- g_variant_builder_add(&b, "{sv}", "type_of_number", g_variant_new_int32( resp->record[i].ton ));
- g_variant_builder_add(&b, "{sv}", "numbering_plan_identity", g_variant_new_int32( resp->record[i].npi ));
- g_variant_builder_add(&b, "{sv}", "forwarding_number", g_variant_new_string( resp->record[i].number ));
- g_variant_builder_close(&b);
- }
-
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_deregister_forwarding(dbus_info->interface_object, dbus_info->invocation, result, resp->err);
-
- } break;
-
- case TRESP_SS_FORWARDING_GET_STATUS: {
-
- const struct tresp_ss_forwarding *resp = data;
-
- dbg("receive TRESP_SS_FORWARDING_GET_STATUS (err[%d])", resp->err);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for (i=0; i<resp->record_num; i++) {
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( resp->record[i].class ));
- g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( resp->record[i].status ));
- g_variant_builder_add(&b, "{sv}", "forwarding_mode", g_variant_new_int32( resp->record[i].mode ));
- g_variant_builder_add(&b, "{sv}", "number_present", g_variant_new_int32( resp->record[i].number_present ));
- g_variant_builder_add(&b, "{sv}", "no_reply_time", g_variant_new_int32( resp->record[i].time ));
- g_variant_builder_add(&b, "{sv}", "type_of_number", g_variant_new_int32( resp->record[i].ton ));
- g_variant_builder_add(&b, "{sv}", "numbering_plan_identity", g_variant_new_int32( resp->record[i].npi ));
- g_variant_builder_add(&b, "{sv}", "forwarding_number", g_variant_new_string( resp->record[i].number ));
- g_variant_builder_close(&b);
- }
-
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_get_forwarding_status(dbus_info->interface_object, dbus_info->invocation, result, resp->err);
-
- } break;
-
- case TRESP_SS_WAITING_ACTIVATE: {
-
- const struct tresp_ss_waiting *resp = data;
-
- dbg("receive TRESP_SS_WAITING_ACTIVATE (err[%d])", resp->err);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for (i=0; i<resp->record_num; i++) {
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( resp->record[i].class ));
- g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( resp->record[i].status ));
- g_variant_builder_close(&b);
- }
-
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_activate_waiting(dbus_info->interface_object, dbus_info->invocation, result, resp->err);
-
- } break;
-
- case TRESP_SS_WAITING_DEACTIVATE: {
-
- const struct tresp_ss_waiting *resp = data;
-
- dbg("receive TRESP_SS_WAITING_DEACTIVATE (err[%d])", resp->err);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for (i=0; i<resp->record_num; i++) {
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( resp->record[i].class ));
- g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( resp->record[i].status ));
- g_variant_builder_close(&b);
- }
-
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_deactivate_waiting(dbus_info->interface_object, dbus_info->invocation, result, resp->err);
-
- } break;
-
- case TRESP_SS_WAITING_GET_STATUS: {
-
- const struct tresp_ss_waiting *resp = data;
-
- dbg("receive TRESP_SS_WAITING_GET_STATUS (err[%d])", resp->err);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for (i=0; i<resp->record_num; i++) {
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( resp->record[i].class ));
- g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( resp->record[i].status ));
- g_variant_builder_close(&b);
- }
-
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_get_waiting_status(dbus_info->interface_object, dbus_info->invocation, result, resp->err);
-
- } break;
-
- case TRESP_SS_CLI_SET_STATUS: {
-
- const struct tresp_ss_set_cli *resp = data;
-
- dbg("receive TRESP_SS_CLI_SET_STATUS (err[%d])", resp->err);
-
- telephony_ss_complete_set_clistatus(dbus_info->interface_object, dbus_info->invocation, resp->err);
-
- } break;
-
- case TRESP_SS_CLI_GET_STATUS: {
-
- const struct tresp_ss_cli *resp = data;
-
- dbg("receive TRESP_SS_CLI_GET_STATUS (err[%d])", resp->err);
-
- telephony_ss_complete_get_clistatus(dbus_info->interface_object, dbus_info->invocation, resp->err, resp->type, resp->status);
-
- } break;
-
- case TRESP_SS_SEND_USSD: {
-
- const struct tresp_ss_ussd *resp = data;
-
- dbg("receive TRESP_SS_SEND_USSD (err[%d])", resp->err);
- dbg("USSD : %s (len : %d, type : 0x%x, status : 0x%x, dcs : 0x%x)", resp->str, resp->len, resp->type, resp->status, resp->dcs);
- telephony_ss_complete_send_ussd(dbus_info->interface_object, dbus_info->invocation, resp->err, resp->type, resp->status, resp->dcs, resp->len, (char*)resp->str);
-
- } break;
-
- default:
- dbg("not handled command[%d]", command);
- break;
- }
-
- return TRUE;
-}
-
-gboolean dbus_plugin_ss_notification(struct custom_data *ctx, CoreObject *source, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data)
-{
- TelephonySs *ss = 0;
- GVariant *result = 0;
- GVariantBuilder b;
- int i = 0;
- char *cp_name= NULL;
-
- if (!object) {
- dbg("object is NULL");
- return FALSE;
- }
- cp_name = (char*)tcore_server_get_cp_name_by_plugin(tcore_object_ref_plugin(source));
-
- ss = telephony_object_peek_ss(TELEPHONY_OBJECT(object));
-
- switch (command) {
- case TNOTI_SS_USSD: {
- const struct tnoti_ss_ussd *ussd = data;
- enum dbus_tapi_sim_slot_id slot_id;
-
- slot_id = get_sim_slot_id_by_cp_name(cp_name);
- dbg("slot_id: [%d]", slot_id);
-
- telephony_ss_emit_notify_ussd(ss,
- ussd->status,
- ussd->dcs,
- ussd->len,
- (char*)ussd->str);
- _launch_ciss(ussd, slot_id);
- } break;
-
- case TNOTI_SS_FORWARDING_STATUS: {
- const struct tnoti_ss_forwarding_status *fwrd = data;
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for (i=0; i<fwrd->record_num; i++) {
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( fwrd->record[i].class ));
- g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( fwrd->record[i].status ));
- g_variant_builder_add(&b, "{sv}", "forwarding_mode", g_variant_new_int32( fwrd->record[i].mode ));
- g_variant_builder_add(&b, "{sv}", "number_present", g_variant_new_int32( fwrd->record[i].number_present ));
- g_variant_builder_add(&b, "{sv}", "no_reply_time", g_variant_new_int32( fwrd->record[i].time ));
- g_variant_builder_add(&b, "{sv}", "type_of_number", g_variant_new_int32( fwrd->record[i].ton ));
- g_variant_builder_add(&b, "{sv}", "numbering_plan_identity", g_variant_new_int32( fwrd->record[i].npi ));
- g_variant_builder_add(&b, "{sv}", "forwarding_number", g_variant_new_string( fwrd->record[i].number ));
- g_variant_builder_close(&b);
- }
-
- result = g_variant_builder_end(&b);
- telephony_ss_emit_notify_forwarding(ss, result);
-
- } break;
-
- case TNOTI_SS_BARRING_STATUS: {
-
- const struct tnoti_ss_barring_status *barr = data;
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for (i=0; i<barr->record_num; i++) {
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( barr->record[i].class ));
- g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( barr->record[i].status ));
- g_variant_builder_add(&b, "{sv}", "barring_mode", g_variant_new_int32( barr->record[i].mode ));
- g_variant_builder_close(&b);
- }
-
- result = g_variant_builder_end(&b);
- telephony_ss_emit_notify_barring(ss, result);
-
- } break;
-
- case TNOTI_SS_WAITING_STATUS: {
- const struct tnoti_ss_waiting_status *wait = data;
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for (i=0; i<wait->record_num; i++) {
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( wait->record[i].class ));
- g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( wait->record[i].status ));
- g_variant_builder_close(&b);
- }
-
- result = g_variant_builder_end(&b);
- telephony_ss_emit_notify_waiting(ss, result);
-
- } break;
-
- case TNOTI_SS_RELEASE_COMPLETE: {
- int i = 0;
- GVariantBuilder builder;
- GVariant *msg_data = 0, *packet = NULL;
- const struct tnoti_ss_release_complete *msg = data;
- if (msg) {
- g_variant_builder_init(&builder, G_VARIANT_TYPE ("ay"));
- for (i = 0; i < msg->data_len; i++) {
- g_variant_builder_add(&builder, "y", msg->data[i]);
- }
- msg_data = g_variant_builder_end(&builder);
- packet = g_variant_new("v", msg_data);
-
- dbg("type_format(%s)", g_variant_get_type_string(packet));
- telephony_ss_emit_release_complete(ss, msg->data_len, packet );
- } else {
- dbg("No data is passed in USSD release notification");
- g_variant_builder_init(&builder, G_VARIANT_TYPE ("ay"));
- g_variant_builder_add(&builder, "y", '\0');
- msg_data = g_variant_builder_end(&builder);
- packet = g_variant_new("v", msg_data);
- dbg("type_format(%s)", g_variant_get_type_string(packet));
- telephony_ss_emit_release_complete(ss, 1, packet);
- }
- } break;
- case TNOTI_SS_INFO: {
- const struct tnoti_ss_information *ss_info = data;
- telephony_ss_emit_notify_ss_info(ss,
- ss_info->err,
- ss_info->ss_type);
- _launch_ciss_information(ss_info);
- /* Launch CISS application
- _launch_ciss(ss_info);
- */
- } break;
- default:
- dbg("not handled command[%d]", command);
- break;
- }
-
- return TRUE;
-}
-