diff options
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | include/serial_private.h | 4 | ||||
-rw-r--r-- | packaging/capi-network-serial.spec | 2 | ||||
-rw-r--r-- | src/serial.c | 15 |
4 files changed, 9 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 68aff7a..2e30fc2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET(INC_DIR include) INCLUDE_DIRECTORIES(${INC_DIR}) -SET(dependents "dlog glib-2.0 capi-base-common dbus-glib-1") +SET(dependents "dlog glib-2.0 capi-base-common dbus-1") SET(pc_dependents "capi-base-common") INCLUDE(FindPkgConfig) diff --git a/include/serial_private.h b/include/serial_private.h index 2e5c88f..7c0ddf3 100644 --- a/include/serial_private.h +++ b/include/serial_private.h @@ -17,8 +17,6 @@ #ifndef __TIZEN_NETWORK_SERIAL_PRIVATE_H__ #define __TIZEN_NETWORK_SERIAL_PRIVATE_H__ -#include <dbus/dbus-glib.h> - #include "serial.h" #ifdef __cplusplus @@ -39,7 +37,7 @@ extern "C" { * @brief Serial handle */ typedef struct _serial_s { - DBusGConnection *client_bus; + DBusConnection *client_bus; int client_socket; int g_watch_id; serial_event_s state_handler; diff --git a/packaging/capi-network-serial.spec b/packaging/capi-network-serial.spec index 9d5d3d3..9afb92a 100644 --- a/packaging/capi-network-serial.spec +++ b/packaging/capi-network-serial.spec @@ -7,10 +7,10 @@ License: Apache-2.0 Source0: %{name}-%{version}.tar.gz Source1001: capi-network-serial.manifest -BuildRequires: pkgconfig(dbus-glib-1) BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(capi-base-common) +BuildRequires: pkgconfig(dbus-1) BuildRequires: cmake diff --git a/src/serial.c b/src/serial.c index 1772bcc..7c5d783 100644 --- a/src/serial.c +++ b/src/serial.c @@ -21,8 +21,6 @@ #include <stdio.h> #include <stdbool.h> #include <dbus/dbus.h> -#include <dbus/dbus-glib.h> -#include <dbus/dbus-glib-lowlevel.h> #include <unistd.h> #include <sys/un.h> #include <sys/socket.h> @@ -231,7 +229,6 @@ int serial_create(serial_h * serial) { DBG("%s\n", __FUNCTION__); - GError *error = NULL; DBusError dbus_error; serial_s *pHandle = NULL; @@ -245,14 +242,12 @@ int serial_create(serial_h * serial) g_type_init(); #endif - pHandle->client_bus = dbus_g_bus_get(DBUS_BUS_SYSTEM, &error); - if (error) { - ERR("Couldn't connect to the System bus[%s]", error->message); - g_error_free(error); + dbus_connection = dbus_bus_get(DBUS_BUS_SYSTEM, NULL); + if (!dbus_connection) { + ERR("Couldn't connect to the System bus"); g_free(pHandle); return SERIAL_ERROR_OPERATION_FAILED; } - dbus_connection = dbus_g_connection_get_connection(pHandle->client_bus); /* Add the filter for network client functions */ dbus_error_init(&dbus_error); @@ -265,6 +260,8 @@ int serial_create(serial_h * serial) return SERIAL_ERROR_OPERATION_FAILED; } + pHandle->client_bus = dbus_connection; + *serial = (serial_h) pHandle; return SERIAL_ERROR_NONE; @@ -322,7 +319,7 @@ int serial_destroy(serial_h serial) } if (pHandle->client_bus != NULL) { - dbus_g_connection_unref(pHandle->client_bus); + dbus_connection_unref(pHandle->client_bus); pHandle->client_bus = NULL; } |