mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-09-06 17:14:02 +00:00
bluetooth/trivial: rename the defines
This commit is contained in:
parent
43c43d5e3a
commit
1a20611f66
|
@ -24,20 +24,20 @@
|
|||
#define BLUETOOTH_CONNECT_DUN "dun"
|
||||
#define BLUETOOTH_CONNECT_NAP "nap"
|
||||
|
||||
#define BLUEZ_SERVICE "org.bluez"
|
||||
#define NM_BLUEZ_SERVICE "org.bluez"
|
||||
|
||||
#define BLUEZ_MANAGER_PATH "/"
|
||||
#define OBJECT_MANAGER_INTERFACE "org.freedesktop.DBus.ObjectManager"
|
||||
#define NM_BLUEZ_MANAGER_PATH "/"
|
||||
#define NM_OBJECT_MANAGER_INTERFACE "org.freedesktop.DBus.ObjectManager"
|
||||
|
||||
#define BLUEZ5_ADAPTER_INTERFACE "org.bluez.Adapter1"
|
||||
#define BLUEZ5_DEVICE_INTERFACE "org.bluez.Device1"
|
||||
#define BLUEZ5_NETWORK_INTERFACE "org.bluez.Network1"
|
||||
#define NM_BLUEZ5_ADAPTER_INTERFACE "org.bluez.Adapter1"
|
||||
#define NM_BLUEZ5_DEVICE_INTERFACE "org.bluez.Device1"
|
||||
#define NM_BLUEZ5_NETWORK_INTERFACE "org.bluez.Network1"
|
||||
|
||||
#define BLUEZ4_MANAGER_INTERFACE "org.bluez.Manager"
|
||||
#define BLUEZ4_ADAPTER_INTERFACE "org.bluez.Adapter"
|
||||
#define BLUEZ4_DEVICE_INTERFACE "org.bluez.Device"
|
||||
#define BLUEZ4_SERIAL_INTERFACE "org.bluez.Serial"
|
||||
#define BLUEZ4_NETWORK_INTERFACE "org.bluez.Network"
|
||||
#define NM_BLUEZ4_MANAGER_INTERFACE "org.bluez.Manager"
|
||||
#define NM_BLUEZ4_ADAPTER_INTERFACE "org.bluez.Adapter"
|
||||
#define NM_BLUEZ4_DEVICE_INTERFACE "org.bluez.Device"
|
||||
#define NM_BLUEZ4_SERIAL_INTERFACE "org.bluez.Serial"
|
||||
#define NM_BLUEZ4_NETWORK_INTERFACE "org.bluez.Network"
|
||||
|
||||
#define NM_BLUEZ_MANAGER_BDADDR_ADDED "bdaddr-added"
|
||||
|
||||
|
|
|
@ -465,7 +465,7 @@ nm_bluez_device_disconnect (NMBluezDevice *self)
|
|||
if (!priv->b4_iface)
|
||||
goto out;
|
||||
args = g_variant_new ("(s)", priv->b4_iface),
|
||||
dbus_iface = BLUEZ4_SERIAL_INTERFACE;
|
||||
dbus_iface = NM_BLUEZ4_SERIAL_INTERFACE;
|
||||
} else if (priv->bluez_version == 5) {
|
||||
#if WITH_BLUEZ5_DUN
|
||||
nm_bluez5_dun_cleanup (priv->b5_dun_context);
|
||||
|
@ -475,16 +475,16 @@ nm_bluez_device_disconnect (NMBluezDevice *self)
|
|||
}
|
||||
} else if (priv->connection_bt_type == NM_BT_CAPABILITY_NAP) {
|
||||
if (priv->bluez_version == 4)
|
||||
dbus_iface = BLUEZ4_NETWORK_INTERFACE;
|
||||
dbus_iface = NM_BLUEZ4_NETWORK_INTERFACE;
|
||||
else if (priv->bluez_version == 5)
|
||||
dbus_iface = BLUEZ5_NETWORK_INTERFACE;
|
||||
dbus_iface = NM_BLUEZ5_NETWORK_INTERFACE;
|
||||
else
|
||||
g_assert_not_reached ();
|
||||
} else
|
||||
g_assert_not_reached ();
|
||||
|
||||
g_dbus_connection_call (priv->dbus_connection,
|
||||
BLUEZ_SERVICE,
|
||||
NM_BLUEZ_SERVICE,
|
||||
priv->path,
|
||||
dbus_iface,
|
||||
"Disconnect",
|
||||
|
@ -577,13 +577,13 @@ nm_bluez_device_connect_async (NMBluezDevice *self,
|
|||
if (connection_bt_type == NM_BT_CAPABILITY_NAP) {
|
||||
connect_type = BLUETOOTH_CONNECT_NAP;
|
||||
if (priv->bluez_version == 4)
|
||||
dbus_iface = BLUEZ4_NETWORK_INTERFACE;
|
||||
dbus_iface = NM_BLUEZ4_NETWORK_INTERFACE;
|
||||
else if (priv->bluez_version == 5)
|
||||
dbus_iface = BLUEZ5_NETWORK_INTERFACE;
|
||||
dbus_iface = NM_BLUEZ5_NETWORK_INTERFACE;
|
||||
} else if (connection_bt_type == NM_BT_CAPABILITY_DUN) {
|
||||
connect_type = BLUETOOTH_CONNECT_DUN;
|
||||
if (priv->bluez_version == 4)
|
||||
dbus_iface = BLUEZ4_SERIAL_INTERFACE;
|
||||
dbus_iface = NM_BLUEZ4_SERIAL_INTERFACE;
|
||||
else if (priv->bluez_version == 5) {
|
||||
#if WITH_BLUEZ5_DUN
|
||||
if (priv->b5_dun_context == NULL)
|
||||
|
@ -602,7 +602,7 @@ nm_bluez_device_connect_async (NMBluezDevice *self,
|
|||
g_assert_not_reached ();
|
||||
|
||||
g_dbus_connection_call (priv->dbus_connection,
|
||||
BLUEZ_SERVICE,
|
||||
NM_BLUEZ_SERVICE,
|
||||
priv->path,
|
||||
dbus_iface,
|
||||
"Connect",
|
||||
|
@ -972,9 +972,9 @@ query_properties (NMBluezDevice *self)
|
|||
g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
|
||||
G_DBUS_PROXY_FLAGS_NONE,
|
||||
NULL,
|
||||
BLUEZ_SERVICE,
|
||||
NM_BLUEZ_SERVICE,
|
||||
g_variant_get_string (v, NULL),
|
||||
BLUEZ5_ADAPTER_INTERFACE,
|
||||
NM_BLUEZ5_ADAPTER_INTERFACE,
|
||||
NULL,
|
||||
(GAsyncReadyCallback) adapter5_on_acquired,
|
||||
g_object_ref (self));
|
||||
|
@ -1134,17 +1134,17 @@ nm_bluez_device_new (const char *path,
|
|||
|
||||
switch (priv->bluez_version) {
|
||||
case 4:
|
||||
interface_name = BLUEZ4_DEVICE_INTERFACE;
|
||||
interface_name = NM_BLUEZ4_DEVICE_INTERFACE;
|
||||
break;
|
||||
case 5:
|
||||
interface_name = BLUEZ5_DEVICE_INTERFACE;
|
||||
interface_name = NM_BLUEZ5_DEVICE_INTERFACE;
|
||||
break;
|
||||
}
|
||||
|
||||
g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
|
||||
G_DBUS_PROXY_FLAGS_NONE,
|
||||
NULL,
|
||||
BLUEZ_SERVICE,
|
||||
NM_BLUEZ_SERVICE,
|
||||
priv->path,
|
||||
interface_name,
|
||||
NULL,
|
||||
|
|
|
@ -264,7 +264,7 @@ check_bluez_and_try_setup_final_step (NMBluezManager *self, int bluez_version, c
|
|||
cleanup_checking (self, FALSE);
|
||||
if (!priv->watch_name_id) {
|
||||
priv->watch_name_id = g_bus_watch_name (G_BUS_TYPE_SYSTEM,
|
||||
BLUEZ_SERVICE,
|
||||
NM_BLUEZ_SERVICE,
|
||||
G_BUS_NAME_WATCHER_FLAGS_NONE,
|
||||
watch_name_on_appeared,
|
||||
NULL,
|
||||
|
@ -317,7 +317,7 @@ check_bluez_and_try_setup_do_introspect (GObject *source_object,
|
|||
/* might not be the best approach to detect the version, but it's good enough in practice. */
|
||||
if (strstr (xml_data, "org.freedesktop.DBus.ObjectManager"))
|
||||
bluez_version = 5;
|
||||
else if (strstr (xml_data, BLUEZ4_MANAGER_INTERFACE))
|
||||
else if (strstr (xml_data, NM_BLUEZ4_MANAGER_INTERFACE))
|
||||
bluez_version = 4;
|
||||
else
|
||||
reason = "unexpected introspect result";
|
||||
|
@ -380,7 +380,7 @@ check_bluez_and_try_setup (NMBluezManager *self)
|
|||
g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
|
||||
G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES | G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
|
||||
NULL,
|
||||
BLUEZ_SERVICE,
|
||||
NM_BLUEZ_SERVICE,
|
||||
"/",
|
||||
DBUS_INTERFACE_INTROSPECTABLE,
|
||||
priv->async_cancellable,
|
||||
|
|
|
@ -364,9 +364,9 @@ nm_bluez4_adapter_new (const char *path, NMSettings *settings)
|
|||
g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
|
||||
G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
|
||||
NULL,
|
||||
BLUEZ_SERVICE,
|
||||
NM_BLUEZ_SERVICE,
|
||||
priv->path,
|
||||
BLUEZ4_ADAPTER_INTERFACE,
|
||||
NM_BLUEZ4_ADAPTER_INTERFACE,
|
||||
priv->proxy_cancellable,
|
||||
_proxy_new_cb,
|
||||
self);
|
||||
|
|
|
@ -296,9 +296,9 @@ nm_bluez4_manager_init (NMBluez4Manager *self)
|
|||
g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
|
||||
G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
|
||||
NULL,
|
||||
BLUEZ_SERVICE,
|
||||
BLUEZ_MANAGER_PATH,
|
||||
BLUEZ4_MANAGER_INTERFACE,
|
||||
NM_BLUEZ_SERVICE,
|
||||
NM_BLUEZ_MANAGER_PATH,
|
||||
NM_BLUEZ4_MANAGER_INTERFACE,
|
||||
priv->proxy_cancellable,
|
||||
_proxy_new_cb,
|
||||
self);
|
||||
|
|
|
@ -186,7 +186,7 @@ object_manager_interfaces_added (GDBusProxy *proxy,
|
|||
GVariant *dict,
|
||||
NMBluez5Manager *self)
|
||||
{
|
||||
if (g_variant_lookup (dict, BLUEZ5_DEVICE_INTERFACE, "a{sv}", NULL))
|
||||
if (g_variant_lookup (dict, NM_BLUEZ5_DEVICE_INTERFACE, "a{sv}", NULL))
|
||||
device_added (proxy, path, self);
|
||||
}
|
||||
|
||||
|
@ -196,7 +196,7 @@ object_manager_interfaces_removed (GDBusProxy *proxy,
|
|||
const char **ifaces,
|
||||
NMBluez5Manager *self)
|
||||
{
|
||||
if (ifaces && g_strv_contains (ifaces, BLUEZ5_DEVICE_INTERFACE))
|
||||
if (ifaces && g_strv_contains (ifaces, NM_BLUEZ5_DEVICE_INTERFACE))
|
||||
device_removed (proxy, path, self);
|
||||
}
|
||||
|
||||
|
@ -225,7 +225,7 @@ get_managed_objects_cb (GDBusProxy *proxy,
|
|||
}
|
||||
g_variant_iter_init (&i, g_variant_get_child_value (variant, 0));
|
||||
while ((g_variant_iter_next (&i, "{&o*}", &path, &ifaces))) {
|
||||
if (g_variant_lookup_value (ifaces, BLUEZ5_DEVICE_INTERFACE,
|
||||
if (g_variant_lookup_value (ifaces, NM_BLUEZ5_DEVICE_INTERFACE,
|
||||
G_VARIANT_TYPE_DICTIONARY)) {
|
||||
device_added (proxy, path, self);
|
||||
}
|
||||
|
@ -281,9 +281,9 @@ bluez_connect (NMBluez5Manager *self)
|
|||
g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
|
||||
G_DBUS_PROXY_FLAGS_NONE,
|
||||
NULL,
|
||||
BLUEZ_SERVICE,
|
||||
BLUEZ_MANAGER_PATH,
|
||||
OBJECT_MANAGER_INTERFACE,
|
||||
NM_BLUEZ_SERVICE,
|
||||
NM_BLUEZ_MANAGER_PATH,
|
||||
NM_OBJECT_MANAGER_INTERFACE,
|
||||
NULL,
|
||||
(GAsyncReadyCallback) on_proxy_acquired,
|
||||
self);
|
||||
|
|
Loading…
Reference in a new issue