#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>
{
DBG("%s\n", __FUNCTION__);
- GError *error = NULL;
DBusError dbus_error;
serial_s *pHandle = NULL;
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);
return SERIAL_ERROR_OPERATION_FAILED;
}
+ pHandle->client_bus = dbus_connection;
+
*serial = (serial_h) pHandle;
return SERIAL_ERROR_NONE;
}
if (pHandle->client_bus != NULL) {
- dbus_g_connection_unref(pHandle->client_bus);
+ dbus_connection_unref(pHandle->client_bus);
pHandle->client_bus = NULL;
}