From 3146f7f55674525b8dd5f030fbd88092166ef2eb Mon Sep 17 00:00:00 2001 From: Ji-hoon Jung Date: Fri, 27 Mar 2015 18:54:00 +0900 Subject: [PATCH] Remove Tapi dependendy Change-Id: I0adcbcbc872c1c994001a676f0a217c4ce5f964f Signed-off-by: Ji-hoon Jung --- CMakeLists.txt | 2 +- debian/control | 2 +- include/dr-modem.h | 9 ----- packaging/data-router.spec | 3 +- src/dr-modem.c | 31 +---------------- src/dr-noti-handler.c | 87 ---------------------------------------------- 6 files changed, 4 insertions(+), 130 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fae83a3..fac016d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include) INCLUDE(FindPkgConfig) -pkg_check_modules(pkgs REQUIRED glib-2.0 tapi +pkg_check_modules(pkgs REQUIRED glib-2.0 dbus-glib-1 dlog vconf ) diff --git a/debian/control b/debian/control index 4985e2e..b2016fd 100755 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: data-router Section: misc Priority: extra Maintainer: Hocheol Seo , InJun Yang , Seungyoun Ju -Build-Depends: debhelper (>= 5), autotools-dev, libslp-setting-dev, dlog-dev, libslp-tapi-dev, libssl-dev +Build-Depends: debhelper (>= 5), autotools-dev, libslp-setting-dev, dlog-dev, libssl-dev Standards-Version: 3.7.2 Package: data-router-bin diff --git a/include/dr-modem.h b/include/dr-modem.h index 1c51539..ec2e6c5 100644 --- a/include/dr-modem.h +++ b/include/dr-modem.h @@ -28,13 +28,4 @@ #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_ diff --git a/packaging/data-router.spec b/packaging/data-router.spec index 6b9faa8..d3104b9 100644 --- a/packaging/data-router.spec +++ b/packaging/data-router.spec @@ -10,7 +10,6 @@ BuildRequires: cmake BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(dbus-glib-1) BuildRequires: pkgconfig(vconf) -BuildRequires: pkgconfig(tapi) Requires(post): /usr/bin/vconftool %description @@ -22,7 +21,7 @@ For USB serial communication, reads/writes usb node and routes them to Socket cl cp %{SOURCE1001} . %build -%cmake . +%cmake . make %{?jobs:-j%jobs} %install diff --git a/src/dr-modem.c b/src/dr-modem.c index 204278e..9e58167 100644 --- a/src/dr-modem.c +++ b/src/dr-modem.c @@ -21,9 +21,6 @@ */ -#include -#include -#include #include "dr-modem.h" #include "dr-usb.h" #include "dr-common.h" @@ -31,34 +28,8 @@ 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; + return 0; } diff --git a/src/dr-noti-handler.c b/src/dr-noti-handler.c index fca6253..9b0db91 100644 --- a/src/dr-noti-handler.c +++ b/src/dr-noti-handler.c @@ -23,9 +23,6 @@ #include #include -#include -#include -#include #include "dr-main.h" #include "dr-usb.h" @@ -38,8 +35,6 @@ extern dr_info_t dr_info; volatile gboolean dsr_status = FALSE; -TapiHandle *tapi_handle = NULL; - static void __usb_status_noti_handler(void *data) { @@ -128,95 +123,13 @@ void _unregister_vconf_notification(void) 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; } -- 2.7.4