summaryrefslogtreecommitdiff
path: root/plugins/common/bluetooth5.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/common/bluetooth5.cpp')
-rw-r--r--plugins/common/bluetooth5.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/common/bluetooth5.cpp b/plugins/common/bluetooth5.cpp
index f836b422..5bdbd2f1 100644
--- a/plugins/common/bluetooth5.cpp
+++ b/plugins/common/bluetooth5.cpp
@@ -6,6 +6,8 @@
#include <gio/gunixfdlist.h>
#include <string>
+GBusType bustype=G_BUS_TYPE_SYSTEM;
+
static const gchar introspection_xml[] =
"<node>"
" <interface name='org.bluez.Profile1'>"
@@ -121,7 +123,7 @@ std::string findDevice(std::string address, std::string adapterPath="")
std::string objectPath;
GError * proxyError = nullptr;
- auto managerProxy = amb::make_super(g_dbus_proxy_new_for_bus_sync(G_BUS_TYPE_SYSTEM, G_DBUS_PROXY_FLAGS_NONE, NULL,
+ auto managerProxy = amb::make_super(g_dbus_proxy_new_for_bus_sync(bustype, G_DBUS_PROXY_FLAGS_NONE, NULL,
"org.bluez",
"/",
"org.freedesktop.DBus.ObjectManager",
@@ -215,7 +217,7 @@ Bluetooth5::Bluetooth5()
GDBusInterfaceInfo* mInterfaceInfo = g_dbus_node_info_lookup_interface(introspection, "org.bluez.Profile1");
- mConnection = amb::make_super(g_bus_get_sync(G_BUS_TYPE_SYSTEM, nullptr, &errorBus));
+ mConnection = amb::make_super(g_bus_get_sync(bustype, nullptr, &errorBus));
auto errorBusPtr = amb::make_super(errorBus);
@@ -308,7 +310,7 @@ void Bluetooth5::connect(ConnectedCallback onconnectedCallback)
GError* error = nullptr;
- auto deviceProxyPtr = amb::make_super(g_dbus_proxy_new_for_bus_sync(G_BUS_TYPE_SYSTEM,G_DBUS_PROXY_FLAGS_NONE,NULL,
+ auto deviceProxyPtr = amb::make_super(g_dbus_proxy_new_for_bus_sync(bustype,G_DBUS_PROXY_FLAGS_NONE,NULL,
"org.bluez", mPath.c_str(), "org.bluez.Device1", nullptr, &error));
auto errorPtr = amb::make_super(error);
@@ -341,7 +343,7 @@ void Bluetooth5::disconnect()
{
GError* error = nullptr;
- auto deviceProxyPtr = amb::make_super(g_dbus_proxy_new_for_bus_sync(G_BUS_TYPE_SYSTEM,G_DBUS_PROXY_FLAGS_NONE,NULL,
+ auto deviceProxyPtr = amb::make_super(g_dbus_proxy_new_for_bus_sync(bustype,G_DBUS_PROXY_FLAGS_NONE,NULL,
"org.bluez", mPath.c_str(), "org.bluez.Device1", nullptr, &error));
auto errorPtr = amb::make_super(error);