--- /dev/null
+Hocheol Seo <hocheol.seo at samsung dot com>
+Injun Yang <injun.yang at samsung dot com>
+Seungyoun Ju <sy39.ju at samsung dot com>
--- /dev/null
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(data-router C)
+
+SET(SRCS src/dr-main.c
+src/dr-modem.c
+src/dr-usb.c
+src/dr-noti-handler.c
+src/dr-util.c
+src/dr-common.c
+src/dr-parser.c
+src/dr-ipc.c
+)
+
+
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED glib-2.0 tapi
+ dbus-glib-1
+ dlog vconf
+ )
+
+FOREACH(flag ${pkgs_CFLAGS})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+#SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -finstrument-functions")
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+SET(BINDIR "/usr/bin")
+SET(EXEC_PREFIX "\${prefix}")
+SET(INCLUDEDIR "/usr/include")
+SET(VERSION 1.0)
+
+ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
+ADD_DEFINITIONS("-DFACTORYFS=\"$ENV{FACTORYFS}\"")
+ADD_DEFINITIONS("-DTARGET")
+
+ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
+
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})
--- /dev/null
+
+ 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.
--- /dev/null
+Copyright (c) Samsung Electronics Co., Ltd. All rights reserved.
+Except as noted, this software is licensed under Apache License, Version 2.
+Please, see the LICENSE.APLv2 file for Apache License terms and conditions.
--- /dev/null
+<manifest>
+ <request>
+ <domain name="_"/>
+ </request>
+</manifest>
--- /dev/null
+data-router (0.2.14) unstable; urgency=low
+
+ * Upload the package
+ * Git: slp/pkgs/d/data-router
+ * Tag: data-router_0.2.14
+
+ -- InJun Yang <injun.yang@samsung.com> Sat, 08 Sep 2012 00:10:56 +0900
+
+data-router (0.2.13) unstable; urgency=low
+
+ * Remove libdata-router package
+ * Git: slp/pkgs/d/data-router
+ * Tag: data-router_0.2.13
+
+ -- InJun Yang <injun.yang@samsung.com> Thu, 09 Aug 2012 17:32:13 +0900
+
+data-router (0.2.12) unstable; urgency=low
+
+ * Upload the package
+ * Git: slp/pkgs/d/data-router
+ * Tag: data-router_0.2.12
+
+ -- InJun Yang <injun.yang@samsung.com> Wed, 08 Aug 2012 15:44:19 +0900
+
+data-router (0.2.11) unstable; urgency=low
+
+ * Upload the package
+ * Git: slp/pkgs/d/data-router
+ * Tag: data-router_0.2.11
+
+ -- InJun Yang <injun.yang@samsung.com> Wed, 08 Aug 2012 10:20:48 +0900
+
+data-router (0.2.10) unstable; urgency=low
+
+ * Upload the package
+ * Git: slp/pkgs/d/data-router
+ * Tag: data-router_0.2.10
+
+ -- InJun Yang <injun.yang@samsung.com> Fri, 03 Aug 2012 16:55:10 +0900
+
+data-router (0.2.9) unstable; urgency=low
+
+ * Fix crash issue on U1 Target
+ * Git: slp/pkgs/d/data-router
+ * Tag: data-router_0.2.9
+
+ -- Seungyoun Ju <sy39.ju@samsung.com> Thu, 05 Jul 2012 13:51:37 +0900
+
+data-router (0.2.8) unstable; urgency=low
+
+ * Upload the package
+ * Git: slp/pkgs/d/data-router
+ * Tag: data-router_0.2.8
+
+ -- Sunbong Ha <sunbong.ha@samsung.com> Thu, 07 Jun 2012 11:13:00 +0900
+
+data-router (0.2.7) unstable; urgency=low
+
+ * Delete vconf key
+ * Git: slp/pkgs/d/data-router
+ * Tag: data-router_0.2.7
+
+ -- InJun Yang <injun.yang@samsung.com> Thu, 24 May 2012 14:27:19 +0900
+
+data-router (0.2.6) unstable; urgency=low
+
+ * Fix the CTS issue
+ * Git: slp/pkgs/d/data-router
+ * Tag: data-router_0.2.6
+
+ -- InJun Yang <injun.yang@samsung.com> Tue, 15 May 2012 16:44:31 +0900
+
+data-router (0.2.5) unstable; urgency=low
+
+ * Modify dr library
+ * Git: slp/pkgs/d/data-router
+ * Tag: data-router_0.2.5
+
+ -- InJun Yang <injun.yang@samsung.com> Fri, 11 May 2012 10:38:04 +0900
+
+data-router (0.2.4) unstable; urgency=low
+
+ * Vconkey for mobex is changed
+ * Git: slp/pkgs/d/data-router
+ * Tag: data-router_0.2.4
+
+ -- Seungyoun Ju <sy39.ju@samsung.com> Fri, 04 May 2012 09:06:38 +0900
+
+data-router (0.2.3) unstable; urgency=low
+
+ * Upload the package
+ * Git: slp/pkgs/d/data-router
+ * Tag: data-router_0.2.3
+
+ -- InJun Yang <injun.yang@samsung.com> Mon, 02 Apr 2012 20:01:11 +0900
+
+data-router (0.2.2) unstable; urgency=low
+
+ * Upload the package
+ * Git: slp/pkgs/d/data-router
+ * Tag: data-router_0.2.2
+
+ -- InJun Yang <injun.yang@samsung.com> Fri, 23 Mar 2012 11:00:15 +0900
+
+data-router (0.2.1) unstable; urgency=low
+
+ * Deprecated API removed
+ * Git: slp/pkgs/d/data-router
+ * Tag: data-router_0.2.1
+
+ -- InJun Yang <injun.yang@samsung.com> Thu, 15 Mar 2012 13:39:26 +0900
+
+data-router (0.2.0) unstable; urgency=low
+
+ * upload the package
+ * Git: slp/pkgs/d/data-router
+ * Tag: data-router_0.2.0
+
+ -- InJun Yang <injun.yang@samsung.com> Wed, 14 Mar 2012 20:23:30 +0900
+
+data-router (0.1.9) unstable; urgency=low
+
+ * WiFi socket server removed
+ * Git: slp/pkgs/d/data-router
+ * Tag: data-router_0.1.9
+
+ -- InJun Yang <injun.yang@samsung.com> Mon, 12 Mar 2012 13:33:25 +0900
+
+data-router (0.1.8) unstable; urgency=low
+
+ * Upload the package
+ * Git: slp/pkgs/d/data-router
+ * Tag: data-router_0.1.8
+
+ -- Sunbong Ha <sunbong.ha@samsung.com> Thu, 08 Mar 2012 11:40:56 +0900
+
+data-router (0.1.7) unstable; urgency=low
+
+ * Enable Server/Client interface
+ * Git: slp/pkgs/d/data-router
+ * Tag: data-router_0.1.7
+
+ -- InJun Yang <injun.yang@samsung.com> Wed, 29 Feb 2012 14:01:19 +0900
+
+data-router (0.1.6) unstable; urgency=low
+
+ * Upload the package
+ * Git: slp/pkgs/d/data-router
+ * Tag: data-router_0.1.6
+
+ -- Sunbong Ha <sunbong.ha@samsung.com> Thu, 23 Feb 2012 09:01:35 +0900
+
+data-router (0.1.5) unstable; urgency=low
+
+ * Upload the package
+ * Git: slp/pkgs/d/data-router
+ * Tag: data-router_0.1.5
+
+ -- Sunbong Ha <sunbong.ha@samsung.com> Wed, 22 Feb 2012 18:51:52 +0900
+
+data-router (0.1.4) unstable; urgency=low
+
+ * Upload the package
+ * Git: slp/pkgs/d/data-router
+ * Tag: data-router_0.1.4
+
+ -- InJun Yang <injun.yang@samsung.com> Mon, 20 Feb 2012 18:55:04 +0900
+
+data-router (0.1.3) unstable; urgency=low
+
+ * Apply MDM policy
+ * Git: slp/pkgs/d/data-router
+ * Tag: data-router_0.1.3
+
+ -- InJun Yang <injun.yang@samsung.com> Tue, 17 Jan 2012 17:33:28 +0900
+
+data-router (0.1.2) unstable; urgency=low
+
+ * Apply SVNET_2 modem interface
+ * Git: slp/pkgs/d/data-router
+ * Tag: data-router_0.1.2
+
+ -- InJun Yang <injun.yang@samsung.com> Tue, 10 Jan 2012 14:51:37 +0900
+
+data-router (0.1.1) unstable; urgency=low
+
+ * Enable Wall compile option
+ * Git: slp/pkgs/d/data-router
+ * Tag: data-router_0.1.1
+
+ -- InJun Yang <injun.yang@samsung.com> Wed, 28 Dec 2011 15:20:36 +0900
+
+data-router (0.1.0) unstable; urgency=low
+
+ * Remove bluetooth dependency
+ * Git: slp/pkgs/d/data-router
+ * Tag: data-router_0.1.0
+
+ -- InJun Yang <injun.yang@samsung.com> Wed, 21 Dec 2011 17:33:12 +0900
+
+data-router (0.0.87) unstable; urgency=low
+
+ * update package
+ * Git: slp/pkgs/d/data-router
+ * Tag: data-router_0.0.87
+
+ -- InJun Yang <injun.yang@samsung.com> Wed, 21 Dec 2011 16:28:02 +0900
+
+data-router (0.0.86) unstable; urgency=low
+
+ * update package
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.86
+
+ -- DoHyun Pyun <dh79.pyun@samsung.com> Mon, 05 Dec 2011 08:40:11 +0900
+
+data-router (0.0.85) unstable; urgency=low
+
+ * update package
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.85
+
+ -- InJun Yang <injun.yang@samsung.com> Thu, 24 Nov 2011 21:10:19 +0900
+
+data-router (0.0.84) unstable; urgency=low
+
+ * update package
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.84
+
+ -- Sunbong Ha <sunbong.ha@samsung.com> Wed, 23 Nov 2011 08:52:18 +0900
+
+data-router (0.0.83) unstable; urgency=low
+
+ * update package
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.83
+
+ -- InJun Yang <injun.yang@samsung.com> Sat, 19 Nov 2011 14:06:13 +0900
+
+data-router (0.0.82) unstable; urgency=low
+
+ * update package
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.82
+
+ -- Sunbong Ha <sunbong.ha@samsung.com> Wed, 16 Nov 2011 16:15:30 +0900
+
+data-router (0.0.81) unstable; urgency=low
+
+ * update package
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.81
+
+ -- InJun Yang <injun.yang@samsung.com> Tue, 15 Nov 2011 15:36:06 +0900
+
+data-router (0.0.80) unstable; urgency=low
+
+ * update package
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.80
+
+ -- InJun Yang <injun.yang@samsung.com> Thu, 10 Nov 2011 17:07:56 +0900
+
+data-router (0.0.79) unstable; urgency=low
+
+ * Fix i386 build error
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.79
+
+ -- InJun Yang <injun.yang@samsung.com> Mon, 07 Nov 2011 14:55:42 +0900
+
+data-router (0.0.78) unstable; urgency=low
+
+ * update package
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.78
+
+ -- InJun Yang <injun.yang@samsung.com> Mon, 07 Nov 2011 13:57:47 +0900
+
+data-router (0.0.77) unstable; urgency=low
+
+ * update package
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.77
+
+ -- InJun Yang <injun.yang@samsung.com> Fri, 21 Oct 2011 19:58:40 +0900
+
+data-router (0.0.76) unstable; urgency=low
+
+ * update package
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.76
+
+ -- InJun Yang <injun.yang@samsung.com> Thu, 29 Sep 2011 21:35:15 +0900
+
+data-router (0.0.75) unstable; urgency=low
+
+ * update package
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.75
+
+ -- InJun Yang <injun.yang@samsung.com> Fri, 16 Sep 2011 19:27:23 +0900
+
+data-router (0.0.74) unstable; urgency=low
+
+ * update package
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.74
+
+ -- InJun Yang <injun.yang@samsung.com> Wed, 07 Sep 2011 19:19:44 +0900
+
+data-router (0.0.73) unstable; urgency=low
+
+ * update package
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.73
+
+ -- InJun Yang <injun.yang@samsung.com> Wed, 31 Aug 2011 20:07:05 +0900
+
+data-router (0.0.72) unstable; urgency=low
+
+ * Kies authentication is implmeneted
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.72
+
+ -- Seungyoun Ju <sy39.ju@samsung.com> Sat, 06 Aug 2011 00:14:50 +0900
+
+data-router (0.0.71) unstable; urgency=low
+
+ * Update package
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.71
+
+ -- InJun Yang <injun.yang@samsung.com> Mon, 18 Jul 2011 11:42:38 +0900
+
+data-router (0.0.70) unstable; urgency=low
+
+ * Modify Kies connection
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.70
+
+ -- InJun Yang <injun.yang@samsung.com> Tue, 14 Jun 2011 13:39:26 +0900
+
+data-router (0.0.69) unstable; urgency=low
+
+ * Update package
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.69
+
+ -- InJun Yang <injun.yang@samsung.com> Mon, 13 Jun 2011 11:25:28 +0900
+
+data-router (0.0.68) unstable; urgency=low
+
+ * Update package
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.68
+
+ -- InJun Yang <injun.yang@samsung.com> Thu, 19 May 2011 17:55:27 +0900
+
+data-router (0.0.67) unstable; urgency=low
+
+ * Update package
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.67
+
+ -- InJun Yang <injun.yang@samsung.com> Thu, 12 May 2011 18:24:33 +0900
+
+data-router (0.0.66) unstable; urgency=low
+
+ * Update package
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.66
+
+ -- InJun Yang <injun.yang@samsung.com> Mon, 02 May 2011 16:42:39 +0900
+
+data-router (0.0.65) unstable; urgency=low
+
+ * Update package
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.65
+
+ -- InJun Yang <injun.yang@samsung.com> Thu, 28 Apr 2011 11:53:39 +0900
+
+data-router (0.0.64) unstable; urgency=low
+
+ * Update package
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.64
+
+ -- Injun Yang <injun.yang@samsung.com> Wed, 20 Apr 2011 17:29:50 +0900
+
+data-router (0.0.63) unstable; urgency=low
+
+ * Update package
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.63
+
+ -- Injun Yang <injun.yang@samsung.com> Wed, 20 Apr 2011 10:20:25 +0900
+
+data-router (0.0.62) unstable; urgency=low
+
+ * Update package
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.62
+
+ -- Injun Yang <injun.yang@samsung.com> Wed, 23 Mar 2011 14:47:08 +0900
+
+data-router (0.0.61) unstable; urgency=low
+
+ * Update package
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.61
+
+ -- Injun Yang <injun.yang@samsung.com> Wed, 02 Mar 2011 19:48:12 +0900
+
+data-router (0.0.60) unstable; urgency=low
+
+ * Fix prevent issue
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.60
+
+ -- Injun Yang <injun.yang@samsung.com> Wed, 16 Feb 2011 15:31:48 +0900
+
+data-router (0.0.59) unstable; urgency=low
+
+ * Fix prevent issue
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.59
+
+ -- Injun Yang <injun.yang@samsung.com> Fri, 28 Jan 2011 19:09:38 +0900
+
+data-router (0.0.58) unstable; urgency=low
+
+ * Fix wifi connection issue
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.58
+
+ -- Injun Yang <injun.yang@samsung.com> Mon, 17 Jan 2011 12:59:33 +0900
+
+data-router (0.0.57) unstable; urgency=low
+
+ * AT Command for MMI check is added.
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.57
+
+ -- Seungyoun Ju <sy39.ju@samsung.com> Wed, 12 Jan 2011 20:06:21 +0900
+
+data-router (0.0.56) unstable; urgency=low
+
+ * fix CTS issue for BT, WiFi
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.56
+
+ -- Injun Yang <injun.yang@samsung.com> Wed, 12 Jan 2011 14:45:47 +0900
+
+data-router (0.0.55) unstable; urgency=low
+
+ * Modify code for kies via mobile-ap
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.55
+
+ -- Injun Yang <injun.yang@samsung.com> Wed, 05 Jan 2011 16:13:10 +0900
+
+data-router (0.0.54) unstable; urgency=low
+
+ * Apply security coding style
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.54
+
+ -- Injun Yang <injun.yang@samsung.com> Thu, 30 Dec 2010 11:10:29 +0900
+
+data-router (0.0.53) unstable; urgency=low
+
+ * Close usb device for FUS
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.53
+
+ -- Injun Yang <injun.yang@samsung.com> Mon, 20 Dec 2010 11:11:33 +0900
+
+data-router (0.0.52) unstable; urgency=low
+
+ * Apply the vconf DAC, modify vconf key
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.52
+
+ -- Injun Yang <injun.yang@samsung.com> Fri, 17 Dec 2010 10:45:37 +0900
+
+data-router (0.0.51) unstable; urgency=low
+
+ * Spp disconnection, reset data path
+ * Git: 165.213.180.234:slp/pkgs/d/data-router
+ * Tag: data-router_0.0.51
+
+ -- Injun Yang <injun.yang@samsung.com> Wed, 08 Dec 2010 09:54:11 +0900
+
+data-router (0.0.50) unstable; urgency=low
+
+ * Implement external pdp noti handler, increase buffer size
+ * Git: 165.213.180.234:/git/slp/pkgs/data-router
+ * Tag: data-router_0.0.50
+
+ -- Injun Yang <injun.yang@samsung.com> Wed, 24 Nov 2010 11:59:07 +0900
+
+data-router (0.0.49) unstable; urgency=low
+
+ * When bluetooth activated, create write-thread
+ * Git: 165.213.180.234:/git/slp/pkgs/data-router
+ * Tag: data-router_0.0.49
+
+ -- Injun Yang <injun.yang@samsung.com> Mon, 22 Nov 2010 16:16:06 +0900
+
+data-router (0.0.48) unstable; urgency=low
+
+ * Modify USB init process
+ * Git: 165.213.180.234:/git/slp/pkgs/data-router
+ * Tag: data-router_0.0.48
+
+ -- Injun Yang <injun.yang@samsung.com> Fri, 19 Nov 2010 11:35:13 +0900
+
+data-router (0.0.47) unstable; urgency=low
+
+ * Remove SIGCHLD for cpu burst issue, Modify USB noti handler
+ * Git: 165.213.180.234:/git/slp/pkgs/data-router
+ * Tag: data-router_0.0.47
+
+ -- Injun Yang <injun.yang@samsung.com> Thu, 18 Nov 2010 13:35:40 +0900
+
+data-router (0.0.46) unstable; urgency=low
+
+ * Implement SIGCHLD handler/Hey noti, apply PM contorl
+ * Git: 165.213.180.234:/git/slp/pkgs/data-router
+ * Tag: data-router_0.0.46
+
+ -- Injun Yang <injun.yang@samsung.com> Mon, 08 Nov 2010 11:06:50 +0900
+
+data-router (0.0.45) unstable; urgency=low
+
+ * Launching as root permission, check mobex termission
+ * Git: 165.213.180.234:/git/slp/pkgs/data-router
+ * Tag: data-router_0.0.45
+
+ -- Injun Yang <injun.yang@samsung.com> Tue, 02 Nov 2010 20:56:53 +0900
+
+data-router (0.0.44) unstable; urgency=low
+
+ * Repackage for btstack lib
+ * Git: 165.213.180.234:/git/slp/pkgs/data-router
+ * Tag: data-router_0.0.44
+
+ -- DoHyun Pyun <dh79.pyun@samsung.com> Tue, 02 Nov 2010 13:17:42 +0900
+
+data-router (0.0.43) unstable; urgency=low
+
+ * Modify deviceinfo, Set connection method for mobex
+ * Git: 165.213.180.234:/git/slp/pkgs/data-router
+ * Tag: data-router_0.0.43
+
+ -- Injun Yang <injun.yang@samsung.com> Thu, 28 Oct 2010 21:26:43 +0900
+
+data-router (0.0.42) unstable; urgency=low
+
+ * Add mobex noti handler, Change FUS cmd
+ * Git: 165.213.180.234:/git/slp/pkgs/data-router
+ * Tag: data-router_0.0.42
+
+ -- Injun Yang <injun.yang@samsung.com> Wed, 27 Oct 2010 12:17:47 +0900
+
+data-router (0.0.41) unstable; urgency=low
+ * Apply new AT commands
+ * Git: 165.213.180.234:/git/slp/pkgs/data-router
+ * Tag: data-router_0.0.41
+
+ -- DoHyun Pyun <dh79.pyun@samsung.com> Wed, 20 Oct 2010 21:12:55 +0900
+
+data-router (0.0.40) unstable; urgency=low
+
+ * Upload the package
+ * Git: 165.213.180.234:/git/slp/pkgs/data-router
+ * Tag: data-router_0.0.40
+
+ -- DoHyun Pyun <dh79.pyun@samsung.com> Mon, 11 Oct 2010 20:05:55 +0900
+
+data-router (0.0.39) unstable; urgency=low
+
+ * Upload the package
+ * Git: 165.213.180.234:/git/slp/pkgs/data-router
+ * Tag: data-router_0.0.39
+
+ -- DoHyun Pyun <dh79.pyun@samsung.com> Mon, 11 Oct 2010 10:34:56 +0900
+
+data-router (0.0.38) unstable; urgency=low
+
+ * Send the DTR signal
+ * Git: 165.213.180.234:/git/slp/pkgs/data-router
+ * Tag: data-router_0.0.38
+
+ -- DoHyun Pyun <dh79.pyun@samsung.com> Wed, 06 Oct 2010 17:18:32 +0900
+
+data-router (0.0.37) unstable; urgency=low
+
+ * Upload the package
+ * Git: 165.213.180.234:/git/slp/pkgs/data-router
+ * Tag: data-router_0.0.37
+
+ -- DoHyun Pyun <dh79.pyun@samsung.com> Wed, 06 Oct 2010 10:48:17 +0900
+
+data-router (0.0.36) unstable; urgency=low
+
+ * Add the activating code when BT is on.
+ * Git: 165.213.180.234:/git/slp/pkgs/data-router
+ * Tag: data-router_0.0.36
+
+ -- DoHyun Pyun <dh79.pyun@samsung.com> Thu, 30 Sep 2010 09:41:40 +0900
+
+data-router (0.0.35) unstable; urgency=low
+
+ * Modify the procedure
+ * Git: 165.213.180.234:/git/slp/pkgs/data-router
+ * Tag: data-router_0.0.35
+
+ -- DoHyun Pyun <dh79.pyun@samsung.com> Tue, 27 Sep 2010 16:58:23 +0900
+
+data-router (0.0.34) unstable; urgency=low
+
+ * commented for BS temporarily
+ * Git: 165.213.180.234:/git/slp/pkgs/data-router
+ * Tag: data-router_0.0.34
+
+ -- Hye-Jin Kim <hyejin0906.kim@samsung.com> Mon, 20 Sep 2010 14:19:53 +0900
+
+data-router (0.0.33) unstable; urgency=low
+
+ * Block the print code
+ * Git: 165.213.180.234:/git/slp/pkgs/data-router
+ * Tag: data-router_0.0.33
+
+ -- DoHyun Pyun <dh79.pyun@samsung.com> Fri, 17 Sep 2010 12:13:59 +0900
+
+data-router (0.0.32) unstable; urgency=low
+
+ * Change the model name
+ * Git: 165.213.180.234:/git/slp/pkgs/data-router
+ * Tag: data-router_0.0.32
+
+ -- DoHyun Pyun <dh79.pyun@samsung.com> Mon, 06 Sep 2010 19:45:38 +0900
+
+data-router (0.0.31) unstable; urgency=low
+
+ * Fix socket permission for mobex-engine
+ * Git: 165.213.180.234:/git/slp/pkgs/data-router
+ * Tag: data-router_0.0.31
+
+ -- Seung-Woo Kim <sw0312.kim@samsung.com> Wed, 04 Aug 2010 17:13:52 +0900
+
+data-router (0.0.30) unstable; urgency=low
+
+ * Increase the version number
+ * Git: 165.213.180.234:/git/slp/pkgs/data-router
+ * Tag: data-router_0.0.30
+
+ -- DoHyun Pyun <dh79.pyun@samsung.com> Tue, 03 Aug 2010 10:06:08 +0900
+
+data-router (0.0.29) unstable; urgency=low
+
+ * Apply the phonet socket
+ * Fix a bug about connecting USB
+ * Git: 165.213.180.234:/git/slp/pkgs/data-router
+ * Tag: data-router_0.0.29
+
+ -- DoHyun Pyun <dh79.pyun@samsung.com> Fri, 30 Jul 2010 09:46:21 +0900
+
+data-router (0.0.28) unstable; urgency=low
+
+ * Add BT SPP code for BT KIES connection
+ * Fix build warnings
+ * Git: 165.213.180.234:/git/slp/pkgs/data-router
+ * Tag: data-router_0.0.28
+
+ -- Seung-Woo Kim <sw0312.kim@samsung.com> Tue, 20 Jul 2010 16:12:39 +0900
+
+data-router (0.0.27) unstable; urgency=low
+
+ * Fix to register process name to Telephony for proper PIN control
+ * Git: 165.213.180.234:/git/slp/pkgs/data-router
+ * Tag: data-router_0.0.27
+
+ -- Seung-Woo Kim <sw0312.kim@samsung.com> Mon, 19 Jul 2010 21:33:29 +0900
+
+data-router (0.0.26) unstable; urgency=low
+
+ * Fix to ignore failure of non existing BT status
+ * Git: 165.213.180.234:/git/slp/pkgs/data-router
+ * Tag: data-router_0.0.26
+
+ -- Seung-Woo Kim <sw0312.kim@samsung.com> Fri, 16 Jul 2010 14:21:39 +0900
+
+data-router (0.0.25) unstable; urgency=low
+
+ * Modify the maintainer list
+ * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/data-router-0
+ * Tag: data-router_0.0.25
+
+ -- DoHyun Pyun <dh79.pyun@samsung.com> Thu, 08 Jul 2010 11:17:15 +0900
+
+data-router (0.0.24) unstable; urgency=low
+
+ * Block BT DUN init when USB is connected
+ * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/data-router-0
+ * Tag: data-router_0.0.24
+
+ -- chanyeol.park <chanyeol.park@samsung.com> Fri, 02 Jul 2010 19:22:40 +0900
+
+data-router (0.0.23) unstable; urgency=low
+
+ * Fix BT activaion decision bug
+ * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/data-router-0
+ * Tag: data-router_0.0.23
+
+ -- chanyeol.park <chanyeol.park@samsung.com> Wed, 30 Jun 2010 19:38:20 +0900
+
+data-router (0.0.22) unstable; urgency=low
+
+ * When BT is not activated, DUN is not initialized
+ * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/data-router-0
+ * Tag: data-router_0.0.22
+
+ -- chanyeol.park <chanyeol.park@samsung.com> Wed, 30 Jun 2010 18:05:33 +0900
+
+data-router (0.0.21) unstable; urgency=low
+
+ * DUN is enabled
+ * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/data-router-0
+ * Tag: data-router_0.0.21
+
+ -- chanyeol.park <chanyeol.park@samsung.com> Wed, 30 Jun 2010 16:31:33 +0900
+
+data-router (0.0.20) unstable; urgency=low
+
+ * Apply new TAPI
+ * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/data-router-0
+ * Tag: data-router_0.0.20
+
+ -- chanyeol.park <chanyeol.park@samsung.com> Sat, 29 May 2010 17:27:28 +0900
+
+data-router (0.0.19) unstable; urgency=low
+
+ * Apply new sysman API.
+ * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/data-router-0
+ * Tag: data-router_0.0.19
+
+ -- chanyeol.park <chanyeol.park@samsung.com> Fri, 28 May 2010 20:33:19 +0900
+
+data-router (0.0.18) unstable; urgency=low
+
+ * Roll back DAC
+ * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/data-router-0
+ * Tag: data-router_0.0.18
+
+ -- chanyeol.park <chanyeol.park@samsung.com> Wed, 12 May 2010 13:54:45 +0900
+
+data-router (0.0.17) unstable; urgency=low
+
+ * Apply DAC
+ * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/data-router-0
+ * Tag: data-router_0.0.17
+
+ -- chanyeol.park <chanyeol.park@samsung.com> Wed, 21 Apr 2010 01:37:49 +0900
+
+data-router (0.0.16) unstable; urgency=low
+
+ * fix szSWVersion vconfkey string(getDEVCONINFO())
+ * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/data-router-0
+ * Tag: data-router_0.0.16
+
+ -- kiheung.park <kiheung.park@samsung.com> Tue, 20 Apr 2010 17:05:24 +0900
+
+data-router (0.0.15) unstable; urgency=low
+
+ * USB mmi_check activation
+ * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/data-router-0
+ * Tag: data-router_0.0.15
+
+ -- chanyeol.park <chanyeol.park@samsung.com> Tue, 13 Apr 2010 19:05:24 +0900
+
+data-router (0.0.14) unstable; urgency=low
+
+ * Replace wihle loop with g_main_loop
+ * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/data-router-0
+ * Tag: data-router_0.0.14
+
+ -- chanyeol.park <chanyeol.park@samsung.com> Fri, 09 Apr 2010 13:39:00 +0900
+
+data-router (0.0.13) unstable; urgency=low
+
+ * Block mmi_check execution until mmi_check activation
+ * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/data-router-0
+ * Tag: data-router_0.0.13
+
+ -- chanyeol.park <chanyeol.park@samsung.com> Wed, 07 Apr 2010 18:06:32 +0900
+
+data-router (0.0.12) unstable; urgency=low
+
+ * Fix MMI check program execution
+ * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/data-router-0
+ * Tag: data-router_0.0.12
+
+ -- chanyeol.park <chanyeol.park@samsung.com> Tue, 06 Apr 2010 18:04:20 +0900
+
+data-router (0.0.11) unstable; urgency=low
+
+ * do not send MOBEX START command to mobex-engnie
+
+ -- Park Kiheung <kiheung.park@samsung.com> Thu, 1 Apr 2010 13:49:16 +0900
+
+data-router (0.0.10) unstable; urgency=low
+
+ * add one line feed when ATZ -> OK return
+
+ -- Park Kiheung <kiheung.park@samsung.com> Wed, 31 Mar 2010 13:49:16 +0900
+
+data-router (0.0.9) unstable; urgency=low
+
+ * Toolchanin Upgrade
+
+ -- chanyeol.park <chanyeol.park@samsung.com> Thu, 25 Mar 2010 13:49:16 +0900
+
+data-router (0.0.8) unstable; urgency=low
+
+ * invoke mobex-engine when mboex start arrive
+
+ -- Park Kiheung <kiheung.park@samsung.com> Wed, 10 Mar 2010 19:53:35 +0900
+
+data-router (0.0.7) unstable; urgency=low
+
+ * Synchronize dpkg with git
+
+ -- chanyeol.park <chanyeol.park@samsung.com> Mon, 08 Mar 2010 19:53:35 +0900
+
+data-router (0.0.6) unstable; urgency=low
+
+ * Activate USB DUN
+
+ -- chanyeol.park <chanyeol.park@samsung.com> Mon, 08 Mar 2010 19:17:25 +0900
+
+data-router (0.0.5) unstable; urgency=low
+
+ * Add dpkg maintainer KiHeung Park
+
+ -- chanyeol.park <chanyeol.park@samsung.com> Wed, 10 Feb 2010 21:07:03 +0900
+
+data-router (0.0.4) unstable; urgency=low
+
+ * Fix CR,LF for kies
+
+ -- chanyeol.park <chanyeol.park@samsung.com> Fri, 05 Feb 2010 17:19:14 +0900
+
+data-router (0.0.3) unstable; urgency=low
+
+ * Temporarily add ATZ Response until modem activation.
+
+ -- chanyeol.park <chanyeol.park@samsung.com> Fri, 05 Feb 2010 11:31:17 +0900
+
+data-router (0.0.2) unstable; urgency=low
+
+ * Enabled MMI Check
+
+ -- chanyeol.park <chanyeol.park@samsung.com> Thu, 04 Feb 2010 16:20:14 +0900
+
+data-router (0.0.1) unstable; urgency=low
+
+ * Add Kies, Remove useless module
+
+ -- chanyeol.park <chanyeol.park@samsung.com> Wed, 03 Feb 2010 17:49:20 +0900
+
+data-router (0) unstable; urgency=low
+
+ * Initial Release.
+
+ -- Chan-Yeol Park <chanyeol.park@samsung.com> Wed, 30 Dec 2009 15:00:33 +0900
--- /dev/null
+Source: data-router
+Section: misc
+Priority: extra
+Maintainer: Hocheol Seo <hocheol.seo@samsung.com>, InJun Yang <injun.yang@samsung.com>, Seungyoun Ju <sy39.ju@samsung.com>
+Build-Depends: debhelper (>= 5), autotools-dev, libslp-setting-dev, dlog-dev, libslp-tapi-dev, libssl-dev
+Standards-Version: 3.7.2
+
+Package: data-router-bin
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Data Router
+ For USB serial communication, reads/writes usb node and routes them to Socket client application
+
+
+Package: data-router-bin-dbg
+Section: debug
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, data-router-bin (=${Source-Version})
+Description: Data Router (unstripped)
+ For USB serial communication, reads/writes usb node and routes them to Socket client application
+
--- /dev/null
+@PREFIX@/bin/*
--- /dev/null
+#!/usr/bin/make -f
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+PREFIX ?= /usr
+CFLAGS = -Wall -g
+LDFLAGS ?=
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+ CFLAGS += -O0
+else
+ CFLAGS += -O2
+endif
+
+CFLAGS += -fpie
+LDFLAGS += -pie -Wl,--rpath=$(PREFIX)/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+ # Add here commands to configure the package.
+ CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
+ cmake . -DCMAKE_INSTALL_PREFIX=$(PREFIX)
+ touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp
+ dh_testdir
+
+ # Add here commands to compile the package.
+ $(MAKE)
+ for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
+ cat $$f > $${f%.in}; \
+ sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
+ done
+
+ touch $@
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp
+
+ # Add here commands to clean up after the build process.
+ -$(MAKE) clean
+
+ for f in `find $(CURDIR)/ -name "CMakeCache.txt"`; do \
+ rm -f $${f}; \
+ done
+ for f in `find $(CURDIR)/ -name "CMakeFiles"`; do \
+ rm -rf $${f}; \
+ done
+ for f in `find $(CURDIR)/ -name "cmake_install.cmake"`; do \
+ rm -f $${f}; \
+ done
+ for f in `find $(CURDIR)/ -name "Makefile"`; do \
+ rm -f $${f}; \
+ done
+ for f in `find $(CURDIR)/ -name "install_manifest.txt"`; do \
+ rm -f $${f}; \
+ done
+ for f in `find $(CURDIR)/ -name "*.edj"`; do \
+ rm -f $${f}; \
+ done
+ for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
+ rm -f $${f%.in}; \
+ done
+
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ # Add here commands to install the package into debian/tmp.
+ $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+# dh_installchangelogs
+# dh_installdocs
+# dh_installexamples
+ dh_install --sourcedir=debian/tmp
+# dh_installman
+ dh_link
+ dh_strip --dbg-package=data-router-bin-dbg
+ dh_compress
+ dh_fixperms
+# dh_perl
+ dh_makeshlibs
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
--- /dev/null
+/*
+ * Data-Router
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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 _DR_COMMON_H_
+#define _DR_COMMON_H_
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+#include <glib.h>
+#include <dlog.h>
+
+
+#undef LOG_TAG
+#define LOG_TAG "DATA_ROUTER"
+#define DBG(fmt, args...) SLOGD(fmt, ##args)
+#define ERR(fmt, args...) SLOGE(fmt, ##args)
+
+
+int _get_usb_state(int *usb_state);
+
+#endif
--- /dev/null
+/*
+ * Data-Router
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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 _DR_IPC_H
+#define _DR_IPC_H
+
+#include <glib.h>
+
+/* This enum value should be matching with dr_serial_event_t */
+enum {
+ SERIAL_CLOSED,
+ SERIAL_OPENED,
+};
+
+gboolean _init_dbus_signal(void);
+void _send_serial_status_signal(int event);
+
+void _init_serial_server(void);
+gboolean _deinit_serial_server(void);
+gboolean _is_exist_serial_session(void);
+gboolean _wait_serial_session(void);
+int _write_to_serial_client(char *buf, int buf_len);
+#endif
--- /dev/null
+/*
+ * Data-Router
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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 _DATA_ROUTER_H_
+#define _DATA_ROUTER_H_
+
+#include <sys/types.h>
+#include <sys/un.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <glib.h>
+#include <sys/socket.h>
+#include <pthread.h>
+#include <signal.h>
+#include <net/if.h>
+#include <stdarg.h>
+#include <dlfcn.h>
+#include <vconf.h>
+#include <vconf-keys.h>
+
+
+
+
+/**
+ * @def USB_BUFFER_SIZE
+ * Defines the maximum buffer size for the USB
+ */
+#define USB_BUFFER_SIZE 1500
+#define ERRMSG_SIZE 100
+
+
+/** @internal
+ * This structure has information about the Modem
+ */
+
+typedef union {
+ struct {
+ volatile unsigned int dtr:1;
+ volatile unsigned int rts:1;
+ volatile unsigned int reserved:6;
+ } bits;
+ volatile unsigned char state;
+} dr_modem_input_lines;
+
+typedef union {
+ struct {
+ volatile unsigned int dcd:1;
+ volatile unsigned int dsr:1;
+ volatile unsigned int brk:1;
+ volatile unsigned int ri:1;
+ volatile unsigned int reserved:4;
+ } bits;
+ volatile unsigned char state;
+} dr_modem_output_lines;
+
+
+/** @internal
+ * This structure has information about modem connection lines
+ */
+typedef struct {
+ dr_modem_output_lines output_line_state;
+ dr_modem_input_lines input_line_state;
+} dr_line_info_t;
+
+
+/** @internal
+ * This structure has information about the USB connection
+ */
+typedef struct {
+ gboolean connected; /**< To check whether USB is connected or not */
+ pthread_t thread_id; /**< USB thread id */
+ int usb_fd; /**< USB file descriptor */
+ int usb_ctrl_fd;
+ int data_path; /**< Data path */
+ char data_buffer[USB_BUFFER_SIZE+1]; /**< Data buffer */
+} dr_usb_info_t;
+
+
+/** @internal
+ * This structure has information about the DR
+ */
+typedef struct {
+ dr_usb_info_t usb; /**< Information about USB */
+ dr_line_info_t line; /**< Information about modem status lines */
+} dr_info_t;
+
+
+
+gboolean _deinit_dr(void);
+
+
+#endif //_DATA_ROUTER_H_
--- /dev/null
+/*
+ * Data-Router
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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 _DR_DPRAM_H_
+#define _DR_DPRAM_H_
+
+#include "dr-main.h"
+
+
+/**
+ * @internal
+ * This function is used to control modem interface
+ *
+ * @param [in] status DTR status
+ * @return This function returns whether sending signal to modem via tapi to control modem interface is successful or not
+ */
+int _send_dtr_ctrl_signal(int status);
+
+#endif //_DR_DPRAM_H_
--- /dev/null
+/*
+ * Data-Router
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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 _DR_NOTI_HANDLER_H
+#define _DR_NOTI_HANDLER_H
+
+#include <glib.h>
+
+
+gboolean _register_vconf_notification(void);
+void _unregister_vconf_notification(void);
+
+gboolean _register_telephony_event(void);
+void _unregister_telephony_event(void);
+
+
+#endif /* _DR_NOTI_HANDLER_H */
--- /dev/null
+/*
+ * Data-Router
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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 _DR_PARSER_H_
+#define _DR_PARSER_H_
+
+/* AT tokens */
+enum {
+ TOKEN_ERROR,
+ ATZ_TOKEN,
+ AT_OSP_TOKEN,
+ AT_TIZEN_OSP_TOKEN,
+ OTHER_TOKEN,
+};
+
+
+int _get_at_cmd_type(char *buf);
+
+
+#endif
--- /dev/null
+/*
+ * Data-Router
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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 _DR_USB_H
+#define _DR_USB_H
+
+
+/*
+ * Output control lines.
+ */
+
+#define ACM_CTRL_DTR 0x01
+#define ACM_CTRL_RTS 0x02
+
+
+enum {
+ DTR_OFF,
+ DTR_ON
+};
+
+
+#define GS_CDC_NOTIFY_SERIAL_STATE _IOW('S', 1, int)
+
+
+/** @internal
+ * This function initialises the USB interface
+ *
+ * @return This function returns 0 if the USB has been initialised successfully or it returns -1 on failure
+ *
+ */
+int _init_usb(void);
+
+
+/** @internal
+ * This function deinitialises the USB interface
+ */
+void _deinit_usb(void);
+
+
+/** @internal
+ * This function is used to write data to the USB interface
+ *
+ * @param [in] buf data to be written to USB
+ * @param [in] buf_len no of bytes of data to be written to USB
+ * @return This function returns the no of bytes written to the USB.
+ */
+int _write_to_usb(char *buf, int buf_len);
+
+
+
+/** @internal
+ * This function is used to send modem line state to Host PC
+ *
+ * @param [in] ctrl status of control lines
+ * @return This function returns zero if successful else returns -EIO
+ *
+ */
+int _send_usb_line_state(int ctrl);
+
+
+#endif // _DR_USB_H
--- /dev/null
+/*
+ * Data-Router
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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 _DR_UTIL_H_
+#define _DR_UTIL_H_
+
+
+int _system_cmd(const char *command);
+int _system_cmd_ext(const char *cmd, char *const arg_list[]);
+
+#endif
--- /dev/null
+Name: data-router
+Summary: Data Router
+Version: 0.2.17
+Release: 1
+Group: TO_BE/FILLED_IN
+License: Apache License Version 2.0
+Source0: %{name}-%{version}.tar.gz
+BuildRequires: cmake
+BuildRequires: pkgconfig(dlog)
+BuildRequires: pkgconfig(dbus-glib-1)
+BuildRequires: pkgconfig(vconf)
+BuildRequires: pkgconfig(tapi)
+Requires(post): /usr/bin/vconftool
+
+%description
+Working as a Router for USB communication
+For USB serial communication, reads/writes usb node and routes them to Socket client application.
+
+%prep
+%setup -q
+
+%build
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+%make_install
+
+
+%post
+/usr/bin/vconftool set -t int memory/data_router/osp_serial_open "0" -u 0 -i -f
+%postun
+
+
+%files
+%manifest data-router.manifest
+%defattr(-, root, root)
+/usr/bin/data-router
--- /dev/null
+/*
+ * Data-Router
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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 <glib.h>
+#include <vconf.h>
+#include <vconf-keys.h>
+
+#include "dr-main.h"
+#include "dr-common.h"
+#include "dr-util.h"
+
+int _get_usb_state(int *usb_state)
+{
+ if (-1 == vconf_get_int(VCONFKEY_SYSMAN_USB_STATUS, (void *)usb_state)) {
+ ERR("Vconf get failed\n");
+ return -1;
+ }
+ DBG("USB state : %d\n", *usb_state);
+ return 0;
+}
+
--- /dev/null
+/*
+ * Data-Router
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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 <dbus/dbus.h>
+#include <dbus/dbus-glib.h>
+#include <dbus/dbus-glib-lowlevel.h>
+#include <dbus/dbus-glib-bindings.h>
+#include <glib.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <sys/un.h>
+#include <unistd.h>
+
+#include "dr-common.h"
+#include "dr-usb.h"
+#include "dr-main.h"
+#include "dr-ipc.h"
+
+#define SOCK_WAIT_TIME 10000
+#define SOCK_WAIT_CNT 200
+#define COM_SOCKET_PATH "/tmp/.dr_common_stream"
+#define BUF_SIZE 65536
+#define NETWORK_SERIAL_INTERFACE "Capi.Network.Serial"
+
+DBusConnection *dbus_connection = NULL;
+
+typedef enum {
+ SERIAL_SESSION_DISCONNECTED,
+ SERIAL_SESSION_CONNECTED
+}dr_session_state_t;
+
+typedef struct {
+ int server_socket;
+ int client_socket;
+ int g_watch_id_server;
+ int g_watch_id_client;
+ GIOChannel *g_io;
+ unsigned char state;
+}dr_socket_info_t;
+
+dr_socket_info_t serial_session = {0, };
+
+
+static DBusHandlerResult __dbus_event_filter(DBusConnection *sys_conn,
+ DBusMessage *msg, void *data)
+{
+ const char *path = dbus_message_get_path(msg);
+
+ if (dbus_message_get_type(msg) != DBUS_MESSAGE_TYPE_SIGNAL)
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+
+ if (path == NULL || strcmp(path, "/") == 0)
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+
+ if (dbus_message_is_signal(msg, NETWORK_SERIAL_INTERFACE,
+ "ready_for_serial")) {
+ char *res = NULL;
+ dbus_message_get_args(msg, NULL,
+ DBUS_TYPE_STRING, &res,
+ DBUS_TYPE_INVALID);
+
+ if (g_strcmp0(res, "OK") == 0)
+ _send_serial_status_signal(SERIAL_OPENED);
+ } else {
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+ }
+
+ return DBUS_HANDLER_RESULT_HANDLED;
+}
+
+gboolean _init_dbus_signal(void)
+{
+ DBG("+\n");
+ DBusGConnection *conn;
+ GError *err = NULL;
+ DBusError dbus_error;
+
+ conn = dbus_g_bus_get(DBUS_BUS_SYSTEM, &err);
+ if(!conn) {
+ ERR(" DBUS get failed\n");
+ g_error_free(err);
+ return FALSE;
+ }
+ dbus_connection = dbus_g_connection_get_connection(conn);
+
+ /* Add the filter for network client functions */
+ dbus_error_init(&dbus_error);
+ dbus_connection_add_filter(dbus_connection, __dbus_event_filter, NULL, NULL);
+ dbus_bus_add_match(dbus_connection,
+ "type=signal,interface=" NETWORK_SERIAL_INTERFACE
+ ",member=ready_for_serial", &dbus_error);
+ if (dbus_error_is_set(&dbus_error)) {
+ ERR("Fail to add dbus filter signal\n");
+ dbus_error_free(&dbus_error);
+ }
+
+ DBG("-\n");
+ return TRUE;
+}
+
+void _send_serial_status_signal(int event)
+{
+ DBusMessage *msg = NULL;
+ if(dbus_connection == NULL) return;
+
+ msg = dbus_message_new_signal("/DataRouter",
+ "User.Data.Router.Introspectable",
+ "serial_status");
+ if (!msg) {
+ ERR("Unable to allocate D-Bus signal\n");
+ return;
+ }
+
+ if (!dbus_message_append_args(msg,
+ DBUS_TYPE_INT32, &event,
+ DBUS_TYPE_INVALID)) {
+ ERR("Event sending failed\n");
+ dbus_message_unref(msg);
+ return;
+ }
+ DBG("Send dbus signal : %s\n", event ? "SERIAL_OPENED":"SERIAL_CLOSED");
+ dbus_connection_send(dbus_connection, msg, NULL);
+ dbus_message_unref(msg);
+ return;
+}
+
+
+int _write_to_serial_client(char *buf, int buf_len)
+{
+ int len;
+ if (buf == NULL || buf_len == 0) {
+ ERR("Invalid param\n");
+ return -1;
+ }
+ len = send(serial_session.client_socket, buf, buf_len, MSG_EOR);
+ if (len == -1) {
+ char err_buf[ERRMSG_SIZE] = { 0, };
+ strerror_r(errno, err_buf, ERRMSG_SIZE);
+ ERR("Send failed\n");
+ return -1;
+ }
+
+ return len;
+}
+
+
+static void __close_client_socket()
+{
+ int ret;
+ DBG("Closing socket\n");
+ ret = close(serial_session.client_socket);
+ if (ret == -1) {
+ perror("close error: ");
+ }
+ serial_session.state = SERIAL_SESSION_DISCONNECTED;
+ return;
+}
+
+
+static gboolean __g_io_server_handler(GIOChannel *io, GIOCondition cond, void *data)
+{
+ char buffer[BUF_SIZE+1];
+ int len = 0;
+ int fd;
+ fd = g_io_channel_unix_get_fd(io);
+ memset(buffer, 0, sizeof(buffer));
+ len = recv(fd, buffer, BUF_SIZE, 0);
+ if (len <= 0) {
+ ERR("Connection closed or Error occured : %d\n", len);
+ g_source_remove(serial_session.g_watch_id_server);
+ g_source_remove(serial_session.g_watch_id_client);
+ __close_client_socket();
+ unlink(COM_SOCKET_PATH);
+ return FALSE;
+ }
+
+ _write_to_usb(buffer, len);
+ return TRUE;
+}
+
+
+static gboolean __g_io_accept_handler(GIOChannel *chan, GIOCondition cond, gpointer data)
+{
+ int serverfd;
+ int clientfd;
+ GIOChannel *io;
+ struct sockaddr_un client_addr;
+ socklen_t addrlen;
+ addrlen = sizeof(client_addr);
+
+ if ( cond & (G_IO_NVAL | G_IO_HUP | G_IO_ERR) ) {
+ DBG("GIOCondition %d \n", cond);
+
+ if(serial_session.server_socket >= 0) {
+ close(serial_session.server_socket);
+ serial_session.server_socket = 0;
+ }
+ return FALSE;
+ }
+
+ if(serial_session.state == SERIAL_SESSION_CONNECTED) {
+ DBG("Connection already exists.....\n");
+ return FALSE;
+ }
+
+ DBG("Waiting for connection request\n");
+ serverfd = g_io_channel_unix_get_fd(chan);
+ clientfd = accept(serverfd, (struct sockaddr *)&client_addr, &addrlen);
+ if (clientfd > 0) {
+ DBG("serverfd:%d clientfd:%d\n", serverfd, clientfd);
+
+ io = g_io_channel_unix_new(clientfd);
+ g_io_channel_set_close_on_unref(io, TRUE);
+ serial_session.g_watch_id_client = g_io_add_watch(io, G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL,
+ __g_io_server_handler, NULL);
+ g_io_channel_unref(io);
+
+ serial_session.client_socket= clientfd;
+ serial_session.state = SERIAL_SESSION_CONNECTED;
+ } else {
+ ERR("Accept failed\n");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+static void __create_serial_server()
+{
+ int server_socket;
+ struct sockaddr_un server_addr;
+ mode_t sock_mode;
+
+ if ((server_socket = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) {
+ ERR("sock create error\n");
+ exit(1);
+ }
+
+ bzero(&server_addr, sizeof(server_addr));
+ server_addr.sun_family = AF_UNIX;
+ g_strlcpy(server_addr.sun_path, COM_SOCKET_PATH, sizeof(server_addr.sun_path));
+ unlink(COM_SOCKET_PATH);
+
+ /*---Assign a port number to the socket---*/
+ if (bind(server_socket, (struct sockaddr *)&server_addr, sizeof(server_addr)) != 0) {
+ perror("bind error: ");
+ exit(1);
+ }
+
+ sock_mode = (S_IRWXU | S_IRWXG | S_IRWXO); // has 777 permission
+ if (chmod(COM_SOCKET_PATH, sock_mode) < 0) {
+ perror("chmod error: ");
+ close(server_socket);
+ exit(1);
+ }
+
+ /*---Make it a "listening socket"---*/
+ if (listen(server_socket, 1) != 0) {
+ perror("listen error: ");
+ close(server_socket);
+ exit(1);
+ }
+ serial_session.server_socket = server_socket;
+ serial_session.g_io = g_io_channel_unix_new(server_socket);
+ g_io_channel_set_close_on_unref(serial_session.g_io, TRUE);
+ serial_session.g_watch_id_server = g_io_add_watch(serial_session.g_io,
+ G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL,
+ __g_io_accept_handler, NULL);
+ g_io_channel_unref(serial_session.g_io);
+
+ return;
+}
+
+
+void _init_serial_server(void)
+{
+ __create_serial_server();
+}
+
+gboolean _deinit_serial_server(void)
+{
+ __close_client_socket();
+
+ return TRUE;
+}
+
+gboolean _is_exist_serial_session(void)
+{
+ return (serial_session.state == SERIAL_SESSION_CONNECTED) ? TRUE: FALSE;
+}
+
+gboolean _wait_serial_session(void)
+{
+ int cnt = 0;
+ while (_is_exist_serial_session() == FALSE) {
+ usleep(SOCK_WAIT_TIME);
+ if (cnt++ > SOCK_WAIT_CNT)
+ return FALSE;
+ }
+
+ return TRUE;
+}
--- /dev/null
+/*
+ * Data-Router
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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 <fcntl.h>
+#include <dbus/dbus-glib.h>
+#include <dirent.h>
+#include <dbus/dbus.h>
+
+
+#include "dr-modem.h"
+#include "dr-main.h"
+#include "dr-usb.h"
+#include "dr-noti-handler.h"
+#include "dr-common.h"
+#include "dr-parser.h"
+#include "dr-ipc.h"
+
+
+dr_info_t dr_info;
+GMainLoop *mainloop;
+
+
+static void __signal_handler(int signo)
+{
+ DBG("+\n");
+ DBG("SIGNAL Number [%d] !!! \n", signo);
+ _send_dtr_ctrl_signal(DTR_OFF);
+ DBG("-\n");
+ exit(0);
+}
+
+gboolean _init_dr(void)
+{
+ DBG("+\n");
+ int usb_state = -1;
+
+ signal(SIGINT, __signal_handler);
+ signal(SIGQUIT, __signal_handler);
+ signal(SIGABRT, __signal_handler);
+ signal(SIGSEGV, __signal_handler);
+ signal(SIGTERM, __signal_handler);
+ signal(SIGPIPE, SIG_IGN);
+
+ memset(&dr_info, 0, sizeof(dr_info));
+
+
+ /**************** USB ******************/
+ if (_get_usb_state(&usb_state) != -1) {
+ if (usb_state != VCONFKEY_SYSMAN_USB_DISCONNECTED ) {
+ _init_usb();
+ }
+ }
+
+ DBG("-\n");
+
+ return TRUE;
+}
+
+gboolean _deinit_dr(void)
+{
+ DBG("+\n");
+
+ _unregister_vconf_notification();
+ _unregister_telephony_event();
+
+ DBG("-\n");
+
+ g_main_loop_quit(mainloop);
+
+ return TRUE;
+}
+
+
+int main(int argc, char *argv[])
+{
+ DBG("+\n");
+
+ g_type_init();
+ _init_dbus_signal();
+
+
+ if (!g_thread_supported())
+ g_thread_init(NULL);
+
+ dbus_g_thread_init();
+
+ _register_vconf_notification();
+ _register_telephony_event();
+
+ _init_dr();
+
+ mainloop = g_main_loop_new(NULL, FALSE);
+ g_main_loop_run(mainloop);
+
+ DBG("-\n");
+ return 0;
+}
--- /dev/null
+/*
+ * Data-Router
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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 <ITapiPS.h>
+#include <tapi_common.h>
+#include <ITapiModem.h>
+#include "dr-modem.h"
+#include "dr-usb.h"
+#include "dr-common.h"
+
+
+
+extern dr_info_t dr_info;
+extern TapiHandle *tapi_handle;
+
+
+
+static void __modem_pin_ctrl_cb(TapiHandle *handle, int result, void *data, void *user_data)
+{
+ DBG("__modem_pin_ctrl_cb result : %d \n", result);
+ return;
+}
+
+int _send_dtr_ctrl_signal(int status)
+{
+ int result;
+ tapi_ps_btdun_pincontrol pincontrol;
+
+ pincontrol.signal = GPRS_DATA_SIGNAL_DTR;
+ if (status == DTR_ON) {
+ pincontrol.status = GPRS_SIGNAL_STATUS_ON;
+ DBG("Send DTR+ to Modem \n");
+ } else {
+ pincontrol.status = GPRS_SIGNAL_STATUS_OFF;
+ DBG("Send DTR- to Modem \n");
+ }
+
+ result = tel_control_modem_dun_pin_ctrl(tapi_handle, &pincontrol, __modem_pin_ctrl_cb, NULL);
+ if (result != TAPI_API_SUCCESS) {
+ ERR("DTR sending failed. [Error : %d]\n", result);
+ }
+
+ return result;
+}
--- /dev/null
+/*
+ * Data-Router
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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 <glib.h>
+#include <sys/wait.h>
+#include <ITapiPS.h>
+#include <tapi_common.h>
+#include <ITapiModem.h>
+
+#include "dr-main.h"
+#include "dr-usb.h"
+#include "dr-modem.h"
+#include "dr-common.h"
+
+
+
+#define ACM_WAIT_TIME 300000
+
+extern dr_info_t dr_info;
+volatile gboolean dsr_status = FALSE;
+TapiHandle *tapi_handle = NULL;
+
+
+static void __usb_status_noti_handler(void *data)
+{
+ int usb_state = -1;
+ int usb_mode = -1;
+ int ret;
+
+ if (_get_usb_state(&usb_state) < 0) {
+ ERR(" Unable to get usb status !\n");
+ return;
+ }
+
+ ret = vconf_get_int(VCONFKEY_SETAPPL_USB_MODE_INT, &usb_mode);
+ if (ret != 0) {
+ DBG("Vconf get failed\n");
+ return;
+ }
+
+ DBG("USB noti handler, USB state : %d, Mode : %d\n", usb_state, usb_mode);
+ DBG("usb_fd = 0x%x\n", dr_info.usb.usb_fd);
+
+
+ /*
+ * If USB driver builted in the Kernel, VCONFKEY_SYSMAN_USB_CONNECTED is not used.
+ * If USB driver loaded in DR/MTP then need to check VCONFKEY_SYSMAN_USB_CONNECTED.
+ * After usb driver loaded, MTP will be set vconf value as VCONFKEY_SYSMAN_USB_CONNECTED
+ */
+ if (usb_state != VCONFKEY_SYSMAN_USB_DISCONNECTED &&
+ usb_mode == SETTING_USB_DEFAULT_MODE) {
+ _init_usb();
+ } else if (usb_state == VCONFKEY_SYSMAN_USB_DISCONNECTED) {
+ _deinit_usb();
+ _deinit_dr();
+ }
+ return;
+}
+
+static void __usb_mode_noti_handler(void *data)
+{
+ int usb_state = -1;
+ int usb_mode = -1;
+ int ret;
+
+ ret = vconf_get_int(VCONFKEY_SETAPPL_USB_MODE_INT, &usb_mode);
+ if (ret != 0) {
+ DBG("Vconf get failed\n");
+ return;
+ }
+
+ DBG("USB Mode noti handler, USB Mode : %d\n", usb_mode);
+ DBG("usb_fd = 0x%x\n", dr_info.usb.usb_fd);
+
+ if (usb_mode != SETTING_USB_DEFAULT_MODE) {
+ _deinit_usb();
+ _deinit_dr();
+ }
+
+ return;
+}
+
+
+gboolean _register_vconf_notification(void)
+{
+ int ret;
+
+ ret =
+ vconf_notify_key_changed(VCONFKEY_SYSMAN_USB_STATUS, (vconf_callback_fn) __usb_status_noti_handler, NULL);
+ if (ret < 0) {
+ ERR("Error !!! VCONFKEY reg noti : %s\n", VCONFKEY_SYSMAN_USB_STATUS);
+ }
+
+ ret =
+ vconf_notify_key_changed(VCONFKEY_SETAPPL_USB_MODE_INT,
+ (vconf_callback_fn) __usb_mode_noti_handler, NULL);
+ if (ret < 0) {
+ ERR("Error !!! VCONFKEY reg noti : %s\n", VCONFKEY_SETAPPL_USB_MODE_INT);
+ }
+
+ return TRUE;
+}
+
+void _unregister_vconf_notification(void)
+{
+ vconf_ignore_key_changed(VCONFKEY_SYSMAN_USB_STATUS, (vconf_callback_fn) __usb_status_noti_handler);
+ vconf_ignore_key_changed(VCONFKEY_SETAPPL_USB_MODE_INT, (vconf_callback_fn) __usb_mode_noti_handler);
+ return;
+}
+
+
+static void __dcd_pin_handler(tapi_ps_btdun_pincontrol_status status)
+{
+ DBG(" \n");
+
+ if (status == GPRS_SIGNAL_STATUS_ON) {
+ DBG("Receive DCD + from Modem\n");
+ dr_info.line.output_line_state.bits.dcd = TRUE;
+ DBG("Current modem output line status = 0x%X\n",
+ dr_info.line.output_line_state.state);
+ }else if (status == GPRS_SIGNAL_STATUS_OFF) {
+ DBG("Receive DCD - from Modem\n");
+ dr_info.line.output_line_state.bits.dcd = FALSE;
+ DBG("Current modem output line status = 0x%X\n",
+ dr_info.line.output_line_state.state);
+ }
+ _send_usb_line_state(dr_info.line.output_line_state.state);
+}
+
+static void __dsr_pin_handler(tapi_ps_btdun_pincontrol_status status)
+{
+ if (status == GPRS_SIGNAL_STATUS_ON) {
+ dr_info.line.output_line_state.bits.dsr = TRUE;
+ dsr_status = TRUE;
+ DBG("Receive DSR+ from modem\n");
+ }else if (status == GPRS_SIGNAL_STATUS_OFF) {
+ dr_info.line.output_line_state.bits.dsr = FALSE;
+ dsr_status = FALSE;
+
+ DBG("Receive DSR- from modem\n");
+ }
+ _send_usb_line_state(dr_info.line.output_line_state.state);
+}
+
+
+
+static void __tel_dun_pincontrol_handler(TapiHandle *handle, const char *noti_id, void *data, void *user_data)
+{
+ DBG("+\n");
+
+ if (data == NULL)
+ return;
+
+ tapi_ps_btdun_pincontrol *pinctrl;
+ pinctrl = (tapi_ps_btdun_pincontrol *)data;
+
+ DBG("pincontrol - Signal: %d, status: %d\n", pinctrl->signal, pinctrl->status);
+ switch (pinctrl->signal) {
+ case GPRS_DATA_SIGNAL_DSR:
+ __dsr_pin_handler(pinctrl->status);
+ break;
+ case GPRS_SIGNAL_DCD:
+ __dcd_pin_handler(pinctrl->status);
+ break;
+ default:
+ break;
+ }
+
+ DBG("-\n");
+ return;
+}
+
+gboolean _register_telephony_event(void)
+{
+ int ret;
+
+ tapi_handle = tel_init(NULL);
+ if (tapi_handle == NULL) {
+ ERR("tel_init failed !!!\n");
+ return FALSE;
+ }
+
+ ret = tel_register_noti_event(tapi_handle, TAPI_NOTI_MODEM_DUN_PIN_CTRL,
+ __tel_dun_pincontrol_handler,
+ NULL);
+
+ return TRUE;
+}
+
+void _unregister_telephony_event(void)
+{
+ tel_deregister_noti_event(tapi_handle, TAPI_NOTI_MODEM_DUN_PIN_CTRL);
+
+ if (tel_deinit(tapi_handle) != TAPI_API_SUCCESS) {
+ ERR("tel_deinit failed !!!\n");
+ }
+
+ tapi_handle = NULL;
+
+ return;
+}
+
--- /dev/null
+/*
+ * Data-Router
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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 <time.h>
+#include "dr-main.h"
+#include "dr-parser.h"
+#include "dr-common.h"
+#include "dr-usb.h"
+
+
+typedef struct {
+ const char *at_cmd;
+ int token_type;
+} dr_at_cmd_t;
+
+const dr_at_cmd_t dr_at_cmds[] = {
+ {"ATZ", ATZ_TOKEN},
+ {"AT+OSPSERIALOPEN", AT_OSP_TOKEN},
+ {"tizen.request='tizen.initialize'", AT_TIZEN_OSP_TOKEN},
+ {"", OTHER_TOKEN},
+};
+
+
+int _get_at_cmd_type(char *buf)
+{
+ if (buf == NULL) {
+ return TOKEN_ERROR;
+ }
+
+ int idx;
+
+ for (idx = 0; dr_at_cmds[idx].at_cmd[0] != '\0'; idx++) {
+ if (!g_ascii_strncasecmp
+ ((const gchar *)buf, (const gchar *)dr_at_cmds[idx].at_cmd,
+ strlen(dr_at_cmds[idx].at_cmd))) {
+ DBG("Found %s\n", dr_at_cmds[idx].at_cmd);
+ buf = buf + strlen(dr_at_cmds[idx].at_cmd);
+ return dr_at_cmds[idx].token_type;
+ }
+ }
+
+ return OTHER_TOKEN;
+}
+
--- /dev/null
+/*
+ * Data-Router
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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 <poll.h>
+#include <fcntl.h>
+#include <sys/ipc.h>
+#include <unistd.h>
+#include <termios.h>
+#include <sys/ioctl.h>
+#include <glib.h>
+
+#include "dr-main.h"
+#include "dr-modem.h"
+#include "dr-usb.h"
+#include "dr-parser.h"
+#include "dr-common.h"
+#include "dr-ipc.h"
+
+
+#define SOCK_WAIT_TIME 500000
+#define USB_TTY_NODE "/dev/ttyGS0"
+#define USB_CTL_NODE "/dev/dun"
+
+
+extern dr_info_t dr_info;
+extern volatile gboolean dsr_status;
+
+struct pollfd poll_events[2];
+
+static void *__usb_monitor_thread(void *arg);
+
+
+static int __open_usb_node(void)
+{
+ int usb_fd = 0;
+ int ctl_fd = 0;
+ struct termios tty_termios;
+
+ usb_fd = open(USB_TTY_NODE, O_RDWR);
+ if (usb_fd < 0) {
+ ERR("%s open failed()", USB_TTY_NODE);
+ goto failed;
+ }
+
+ ctl_fd = open(USB_CTL_NODE, O_RDWR);
+ if (ctl_fd < 0) {
+ ERR("%s open failed()", USB_CTL_NODE);
+ goto failed;
+ }
+
+ memset((char *)&tty_termios, 0, sizeof(struct termios));
+
+ if (tcgetattr(usb_fd, &tty_termios) < 0) {
+ char err_buf[ERRMSG_SIZE] = { 0, };
+ strerror_r(errno, err_buf, ERRMSG_SIZE);
+ ERR("tcgetattr error : %s\n", err_buf);
+ goto failed;
+ }
+
+ cfmakeraw(&tty_termios);
+
+ tty_termios.c_iflag &= ~ICRNL;
+ tty_termios.c_iflag &= ~INLCR;
+ tty_termios.c_oflag &= ~OCRNL;
+ tty_termios.c_oflag &= ~ONLCR;
+ tty_termios.c_lflag &= ~ICANON;
+ tty_termios.c_lflag &= ~ECHO;
+
+ if (tcsetattr(usb_fd, TCSANOW, &tty_termios) < 0) {
+ char err_buf[ERRMSG_SIZE] = { 0, };
+ strerror_r(errno, err_buf, ERRMSG_SIZE);
+ ERR("tcsetattr error : %s\n", err_buf);
+ goto failed;
+ }
+
+ poll_events[0].fd = usb_fd;
+ poll_events[0].events = POLLIN | POLLERR | POLLHUP;
+ poll_events[0].revents = 0;
+
+ poll_events[1].fd = ctl_fd;
+ poll_events[1].events = POLLIN | POLLERR | POLLHUP;
+ poll_events[1].revents = 0;
+
+ dr_info.line.output_line_state.state = 0;
+ dr_info.line.input_line_state.state = 0;
+ dr_info.usb.usb_fd = usb_fd;
+ dr_info.usb.usb_ctrl_fd = ctl_fd;
+
+ DBG("usb_fd= 0x%x\n", usb_fd);
+ DBG("usb_ctrl_fd= 0x%x\n", ctl_fd);
+ return 0;
+
+failed:
+ if(usb_fd >= 0) {
+ close(usb_fd);
+ }
+ if(ctl_fd >= 0) {
+ close(ctl_fd);
+ }
+ return -1;
+}
+
+static int __close_usb_node(void)
+{
+ DBG("usb_fd = 0x%x, ctrl_fd = 0x%x\n",
+ dr_info.usb.usb_fd, dr_info.usb.usb_ctrl_fd);
+ if (dr_info.usb.usb_fd > 0) {
+ if (close(dr_info.usb.usb_fd) != 0) {
+ ERR("ttyGS0 Close error\n");
+ return -1;
+ }
+ DBG("ttyGS0 Close success\n");
+ dr_info.usb.usb_fd = 0;
+ }
+
+ if (dr_info.usb.usb_ctrl_fd > 0) {
+ if (close(dr_info.usb.usb_ctrl_fd) != 0) {
+ ERR("ACM Close error\n");
+ return -1;
+ }
+ DBG("ACM Close success\n");
+ dr_info.usb.usb_ctrl_fd = 0;
+ }
+ return 0;
+}
+
+
+
+int _init_usb(void)
+{
+ DBG("+\n ");
+ int ret = 0;
+ ret = __open_usb_node();
+ if (ret < 0) {
+ ERR("USB node open failed\n");
+ return -1;
+ }
+
+ if (0 != pthread_create(&dr_info.usb.thread_id, NULL,
+ __usb_monitor_thread, &dr_info.usb.usb_fd)) {
+ ERR("USB thread launch failed\n");
+ __close_usb_node();
+ return -1;
+ }
+
+ _send_dtr_ctrl_signal(DTR_ON);
+
+ DBG("-\n ");
+ return 0;
+}
+
+
+void _deinit_usb(void)
+{
+ DBG("+\n");
+ int status;
+ if(dr_info.usb.thread_id <= 0) {
+ ERR("Invalid USB interface !!! \n");
+ return;
+ }
+ DBG("USB disconnected!!!!!!!!!!\n");
+
+ _send_dtr_ctrl_signal(DTR_OFF);
+
+ /*This should be called in main thread */
+ pthread_cancel(dr_info.usb.thread_id);
+ pthread_join(dr_info.usb.thread_id, (void **)&status);
+ DBG("Thread status : %d \n", status);
+
+ _send_serial_status_signal(SERIAL_CLOSED);
+ __close_usb_node();
+ DBG("-\n");
+ return;
+}
+
+
+
+int _write_to_usb(char *buf, int buf_len)
+{
+ int write_len;
+
+ write_len = 0;
+ do {
+ int len;
+ len = write(dr_info.usb.usb_fd, buf + write_len,
+ buf_len - write_len);
+ if (len == -1) {
+ ERR("USB write failed\n");
+ break;
+ }
+ write_len += len;
+ } while (write_len < buf_len);
+
+ return write_len;
+}
+
+
+int _send_usb_line_state(int ctrl)
+{
+ int ret;
+
+ ret = ioctl(dr_info.usb.usb_ctrl_fd, GS_CDC_NOTIFY_SERIAL_STATE, ctrl);
+ if (ret < 0) {
+ int err = errno;
+ char err_buf[ERRMSG_SIZE] = { 0, };
+ strerror_r(err, err_buf, ERRMSG_SIZE);
+ ERR("ioctl error : %s (%d)\n", err_buf, err);
+ return -EIO;
+ }
+ return 0;
+}
+
+static void __process_at_cmd(char *buffer, int nread)
+{
+ if(buffer == NULL || nread == 0)
+ return;
+
+ int type;
+ int check_cnt = 0;
+ char *info = NULL;
+
+ DBG("Received: %s [%d byte]\n",buffer, nread);
+ if(TRUE == _is_exist_serial_session()) {
+ _write_to_serial_client(buffer, nread);
+ return;
+ }
+
+ type = _get_at_cmd_type(buffer);
+ if (type == ATZ_TOKEN) {
+ info = "\r\nOK\r\n";
+ _write_to_usb(info, strlen(info));
+ return;
+ } else if (type == AT_OSP_TOKEN || type == AT_TIZEN_OSP_TOKEN) {
+ _init_serial_server();
+
+ if (vconf_set_int("memory/data_router/osp_serial_open", 1) != 0) {
+ ERR("vconf set failed\n");
+ return;
+ }
+
+ if (_wait_serial_session()) {
+ if (type == AT_OSP_TOKEN)
+ info = "\r\nOK\r\n";
+ else
+ info = "\r\ntizen.response='tizen.success'\r\n";
+ } else {
+ if (type == AT_OSP_TOKEN)
+ info = "\r\nERROR\r\n";
+ else
+ info = "\r\ntizen.response='tizen.failure'\r\n";
+ }
+ _write_to_usb(info, strlen(info));
+ return;
+ }
+
+ while (dsr_status == FALSE) {
+ sleep(1);
+ if (check_cnt > 3) {
+ info = "\r\nERROR\r\n";
+ _write_to_usb(info, strlen(info));
+ return;
+ }
+ check_cnt++;
+ }
+ check_cnt = 0;
+
+ return;
+}
+
+
+static void *__usb_monitor_thread(void *arg)
+{
+ int ret = 0;
+ int nread = 0;
+ int usb_fd = 0;
+ int poll_state = 0;
+
+ usb_fd = *((int *)arg);
+ DBG("USB monitor thread launched, usb_fd= 0x%x\n", usb_fd);
+ while (usb_fd) {
+ poll_state = poll((struct pollfd *)&poll_events, 2, -1);
+ if (poll_state > 0) {
+ if (poll_events[0].revents & POLLIN) {
+ memset(dr_info.usb.data_buffer, '\0',
+ sizeof(dr_info.usb.data_buffer));
+ nread = read(usb_fd, &dr_info.usb.data_buffer,
+ sizeof(dr_info.usb.data_buffer)-1);
+ if (nread < 0) {
+ ERR("read length is less then zero\n");
+ if (errno == EINTR) {
+ continue;
+ }
+ perror("Read USB failed");
+ __close_usb_node();
+ pthread_exit(NULL);
+ }
+ __process_at_cmd(dr_info.usb.data_buffer, nread);
+ }
+
+ if (poll_events[0].revents & POLLHUP ||
+ poll_events[0].revents & POLLERR) {
+ ERR("%s occurred !!!\n",
+ (poll_events[0].revents & POLLHUP)
+ ? "POLLHUP" : "POLLERR");
+ __close_usb_node();
+ pthread_exit(NULL);
+ }
+
+ if (poll_events[1].revents & POLLIN) {
+ unsigned int line_state;
+
+ ret = read(dr_info.usb.usb_ctrl_fd,
+ &line_state, sizeof(unsigned int));
+ if (ret < 0) {
+ ERR("read length is less then zero\n");
+ if (errno == EINTR) {
+ continue;
+ }
+ __close_usb_node();
+ pthread_exit(NULL);
+ }
+
+ if ((line_state & ACM_CTRL_DTR) &&
+ (dr_info.line.input_line_state.bits.dtr == FALSE)) {
+ DBG("ACM_CTRL_DTR+ received\n");
+ if(dr_info.line.output_line_state.bits.dsr == FALSE) {
+ /*
+ * When USB initialized, DTR On is set to CP.
+ * If DR set DTR ON twice, Modem will be reponse as DSR Off
+ */
+ _send_dtr_ctrl_signal(DTR_ON);
+ }
+ dr_info.line.input_line_state.bits.dtr = TRUE;
+ } else if ((!(line_state & ACM_CTRL_DTR)) &&
+ (dr_info.line.input_line_state.bits.dtr == TRUE)) {
+ DBG("ACM_CTRL_DTR- received\n");
+ if (_deinit_serial_server() == TRUE) {
+ _send_serial_status_signal(SERIAL_CLOSED);
+ dr_info.line.input_line_state.bits.dtr = FALSE;
+ }
+ }
+ }
+
+ if (poll_events[1].revents & POLLHUP ||
+ poll_events[1].revents & POLLERR) {
+ ERR("%s occurred !!!\n",
+ (poll_events[1].revents & POLLHUP)
+ ? "POLLHUP" : "POLLERR");
+ __close_usb_node();
+ pthread_exit(NULL);
+ }
+ }
+ else if (poll_state == 0)
+ ERR("poll timeout\n");
+ else if (poll_state < 0)
+ ERR("poll error\n");
+ }
+ return NULL;
+}
--- /dev/null
+/*
+ * Data-Router
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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 <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/msg.h>
+#include <sys/time.h>
+#include <errno.h>
+#include <sys/time.h>
+#include <sys/wait.h>
+#include <glib.h>
+
+#include "dr-main.h"
+#include "dr-util.h"
+#include "dr-common.h"
+
+
+
+int _system_cmd(const char *command)
+{
+ int pid = 0, status = 0;
+ char *const environ[] = { NULL };
+
+ if (NULL == command) {
+ ERR("Invalid param !!!\n");
+ return -1;
+ }
+
+ pid = fork();
+
+ if (-1 == pid) {
+ ERR("::: fork failed to create a process :::\n");
+ return -1;
+ }
+
+ if (pid == 0) {
+ char *argv[4];
+
+ argv[0] = "sh";
+ argv[1] = "-c";
+ argv[2] = (char *)command;
+ argv[3] = 0;
+
+ execve("/bin/sh", argv, environ);
+ abort();
+ }
+
+ do {
+ if (waitpid(pid, &status, 0) == -1) {
+ if (errno != EINTR)
+ return -1;
+ } else {
+ return status;
+ }
+
+ } while (1);
+}
+
+int _system_cmd_ext(const char *cmd, char *const arg_list[])
+{
+ int pid, pid2;
+ int status = 0;
+
+ pid = fork();
+ switch (pid) {
+ case -1:
+ perror("fork failed");
+ return -1;
+
+ case 0:
+ pid2 = fork();
+ if(pid2 == 0) {
+ execv(cmd, arg_list);
+ exit(256);
+ } else
+ exit(0);
+ break;
+
+ default:
+ waitpid(pid, &status, 0);
+ break;
+ }
+
+ return 0;
+}
+