diff options
author | Thomas Haller <thaller@redhat.com> | 2017-05-31 22:55:03 +0200 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2017-06-01 11:28:57 +0200 |
commit | 1be01bd51f3e27d82335999586e8efff40b92b87 (patch) | |
tree | a120aa2f2f87faa1f87f68923613f385c8e2dbc5 | |
parent | 29a0876db6205f7a017c335df22d4a115fe04fe5 (diff) | |
download | NetworkManager-1be01bd51f3e27d82335999586e8efff40b92b87.tar.gz |
device: don't include header of bluetooth plugin in nm-device.h
The plugins may use stuff from core, but not the other way around.
Including "bluetooth/nm-bluez-common.h" is wrong.
The UUID argument is always "nap" in the NAP case. We don't need
the flexibility that it might be anything else. Just drop it.
As far as NMDevice is concerned, it anyway wouldn't (or shouldn't
know what the uuid is. It says register, and NMBluez5Manager should
figure out the details.
-rw-r--r-- | src/devices/bluetooth/nm-bluez5-manager.c | 12 | ||||
-rw-r--r-- | src/devices/nm-device.c | 2 | ||||
-rw-r--r-- | src/devices/nm-device.h | 3 |
3 files changed, 7 insertions, 10 deletions
diff --git a/src/devices/bluetooth/nm-bluez5-manager.c b/src/devices/bluetooth/nm-bluez5-manager.c index 2dfc521bc6..a2d1a4c214 100644 --- a/src/devices/bluetooth/nm-bluez5-manager.c +++ b/src/devices/bluetooth/nm-bluez5-manager.c @@ -89,7 +89,6 @@ static void device_usable (NMBluezDevice *device, GParamSpec *pspec, NMBluez5Man typedef struct { char *path; char *addr; - char *uuid; NMDevice *device; CList network_servers; } NetworkServer; @@ -126,7 +125,7 @@ _network_server_unregister (NMBluez5Manager *self, NetworkServer *network_server { NMBluez5ManagerPrivate *priv = NM_BLUEZ5_MANAGER_GET_PRIVATE (self); - if (!network_server->uuid) { + if (!network_server->device) { /* Not connected. */ return; } @@ -140,12 +139,11 @@ _network_server_unregister (NMBluez5Manager *self, NetworkServer *network_server network_server->path, NM_BLUEZ5_NETWORK_SERVER_INTERFACE, "Unregister", - g_variant_new ("(s)", network_server->uuid), + g_variant_new ("(s)", BLUETOOTH_CONNECT_NAP), NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL, NULL); - g_clear_pointer (&network_server->uuid, g_free); g_clear_object (&network_server->device); } @@ -170,7 +168,8 @@ network_server_is_available (const NMBtVTableNetworkServer *vtable, static gboolean network_server_register_bridge (const NMBtVTableNetworkServer *vtable, - const char *addr, const char *uuid, NMDevice *device) + const char *addr, + NMDevice *device) { NMBluez5Manager *self = NETWORK_SERVER_VTABLE_GET_NM_BLUEZ5_MANAGER (vtable); NMBluez5ManagerPrivate *priv = NM_BLUEZ5_MANAGER_GET_PRIVATE (self); @@ -191,13 +190,12 @@ network_server_register_bridge (const NMBtVTableNetworkServer *vtable, network_server->path, NM_BLUEZ5_NETWORK_SERVER_INTERFACE, "Register", - g_variant_new ("(ss)", uuid, nm_device_get_iface (device)), + g_variant_new ("(ss)", BLUETOOTH_CONNECT_NAP, nm_device_get_iface (device)), NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL, NULL); network_server->device = g_object_ref (device); - network_server->uuid = g_strdup (uuid); return TRUE; } diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 252402fb96..8be901b297 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -70,7 +70,6 @@ #include "nm-arping-manager.h" #include "nm-connectivity.h" #include "nm-dbus-interface.h" -#include "bluetooth/nm-bluez-common.h" #include "nm-device-logging.h" _LOG_DECLARE_SELF (NMDevice); @@ -4405,7 +4404,6 @@ bt_network_server_register (NMDevice *self) return FALSE; return nm_bt_vtable_network_server->register_bridge (nm_bt_vtable_network_server, nm_setting_bluetooth_get_bdaddr (s_bt), - BLUETOOTH_CONNECT_NAP, self); } diff --git a/src/devices/nm-device.h b/src/devices/nm-device.h index 271810d293..00685ee29b 100644 --- a/src/devices/nm-device.h +++ b/src/devices/nm-device.h @@ -710,7 +710,8 @@ struct _NMBtVTableNetworkServer { gboolean (*is_available) (const NMBtVTableNetworkServer *vtable, const char *addr); gboolean (*register_bridge) (const NMBtVTableNetworkServer *vtable, - const char *addr, const char *uuid, NMDevice *device); + const char *addr, + NMDevice *device); gboolean (*unregister_bridge) (const NMBtVTableNetworkServer *vtable, NMDevice *device); }; |