return g_error_new(BT_CORE_ERROR, error, err_msg, NULL);
}
-static DBusGProxy *_bt_get_adapter_proxy(void)
+static DBusGProxy *_bt_get_connman_proxy(void)
{
DBusGProxy *proxy;
- char *adapter_path = NULL;
if (conn == NULL) {
conn = dbus_g_bus_get(DBUS_BUS_SYSTEM, NULL);
retv_if(conn == NULL, NULL);
}
- proxy = dbus_g_proxy_new_for_name(conn, BT_BLUEZ_NAME,
- BT_BLUEZ_HCI_PATH, BT_PROPERTIES_INTERFACE);
+ proxy = dbus_g_proxy_new_for_name(conn,
+ CONNMAN_DBUS_NAME,
+ CONNMAN_BLUETOOTH_TECHNOLOGY_PATH,
+ CONNMAN_BLUETOTOH_TECHNOLOGY_INTERFACE);
retv_if(proxy == NULL, NULL);
return proxy;
GError *error = NULL;
DBusGProxy *proxy;
- proxy = _bt_get_adapter_proxy();
+ proxy = _bt_get_connman_proxy();
retv_if(proxy == NULL, BLUETOOTH_ERROR_INTERNAL);
g_value_init(&state, G_TYPE_BOOLEAN);
g_value_set_boolean(&state, powered);
- BT_DBG("send power state: %d to bluez", powered);
+ BT_DBG("set power property state: %d to connman", powered);
- dbus_g_proxy_call(proxy, "Set", &error,
- G_TYPE_STRING, BT_ADAPTER_INTERFACE,
+ dbus_g_proxy_call(proxy, "SetProperty", &error,
G_TYPE_STRING, "Powered",
G_TYPE_VALUE, &state,
G_TYPE_INVALID, G_TYPE_INVALID);
} \
} while (0)
-#define BT_BLUEZ_NAME "org.bluez"
-#define BT_BLUEZ_HCI_PATH "/org/bluez/hci0"
-#define BT_ADAPTER_INTERFACE "org.bluez.Adapter1"
-#define BT_PROPERTIES_INTERFACE "org.freedesktop.DBus.Properties"
+#define CONNMAN_DBUS_NAME "net.connman"
+#define CONNMAN_BLUETOOTH_TECHNOLOGY_PATH "/net/connman/technology/bluetooth"
+#define CONNMAN_BLUETOTOH_TECHNOLOGY_INTERFACE "net.connman.Technology"
#define BT_CORE_NAME "org.projectx.bt_core"
#define BT_CORE_PATH "/org/projectx/bt_core"