modem: add define for ModemManager D-Bus path
Also, bluetooth plugin uses NMModem from the wwan plugin. Don't include such a foreign header in a "nm-device-bt.h". Instead, forward declare what we need.
This commit is contained in:
@@ -40,15 +40,14 @@
|
||||
#include "nm-bt-error.h"
|
||||
#include "platform/nm-platform.h"
|
||||
|
||||
#include "devices/wwan/nm-modem-manager.h"
|
||||
#include "devices/wwan/nm-modem.h"
|
||||
|
||||
#include "introspection/org.freedesktop.NetworkManager.Device.Bluetooth.h"
|
||||
|
||||
#include "devices/nm-device-logging.h"
|
||||
_LOG_DECLARE_SELF(NMDeviceBt);
|
||||
|
||||
#define MM_DBUS_SERVICE "org.freedesktop.ModemManager1"
|
||||
#define MM_DBUS_PATH "/org/freedesktop/ModemManager1"
|
||||
#define MM_DBUS_INTERFACE "org.freedesktop.ModemManager1"
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||
@@ -1060,9 +1059,9 @@ nm_device_bt_init (NMDeviceBt *self)
|
||||
G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS |
|
||||
G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
|
||||
NULL,
|
||||
MM_DBUS_SERVICE,
|
||||
MM_DBUS_PATH,
|
||||
MM_DBUS_INTERFACE,
|
||||
NM_MODEM_MANAGER_MM_DBUS_SERVICE,
|
||||
NM_MODEM_MANAGER_MM_DBUS_PATH,
|
||||
NM_MODEM_MANAGER_MM_DBUS_INTERFACE,
|
||||
NULL, &error);
|
||||
if (priv->mm_proxy) {
|
||||
g_signal_connect (priv->mm_proxy, "notify::g-name-owner",
|
||||
@@ -1071,7 +1070,7 @@ nm_device_bt_init (NMDeviceBt *self)
|
||||
mm_name_owner_changed (G_OBJECT (priv->mm_proxy), NULL, self);
|
||||
} else {
|
||||
_LOGW (LOGD_MB, "Could not create proxy for '%s': %s",
|
||||
MM_DBUS_SERVICE, error->message);
|
||||
NM_MODEM_MANAGER_MM_DBUS_SERVICE, error->message);
|
||||
g_clear_error (&error);
|
||||
}
|
||||
}
|
||||
|
@@ -24,8 +24,6 @@
|
||||
#include "devices/nm-device.h"
|
||||
#include "nm-bluez-device.h"
|
||||
|
||||
#include "devices/wwan/nm-modem.h"
|
||||
|
||||
#define NM_TYPE_DEVICE_BT (nm_device_bt_get_type ())
|
||||
#define NM_DEVICE_BT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_BT, NMDeviceBt))
|
||||
#define NM_DEVICE_BT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_BT, NMDeviceBtClass))
|
||||
@@ -52,8 +50,10 @@ NMDevice *nm_device_bt_new (NMBluezDevice *bt_device,
|
||||
|
||||
guint32 nm_device_bt_get_capabilities (NMDeviceBt *device);
|
||||
|
||||
struct _NMModem;
|
||||
|
||||
gboolean nm_device_bt_modem_added (NMDeviceBt *device,
|
||||
NMModem *modem,
|
||||
struct _NMModem *modem,
|
||||
const char *driver);
|
||||
|
||||
#endif /* __NETWORKMANAGER_DEVICE_BT_H__ */
|
||||
|
@@ -296,8 +296,8 @@ modm_manager_poke (NMModemManager *self)
|
||||
|
||||
/* If there is no current owner right away, ensure we poke to get one */
|
||||
g_dbus_connection_call (priv->dbus_connection,
|
||||
"org.freedesktop.ModemManager1",
|
||||
"/org/freedesktop/ModemManager1",
|
||||
NM_MODEM_MANAGER_MM_DBUS_SERVICE,
|
||||
NM_MODEM_MANAGER_MM_DBUS_PATH,
|
||||
DBUS_INTERFACE_PEER,
|
||||
"Ping",
|
||||
NULL,
|
||||
|
@@ -34,6 +34,10 @@
|
||||
|
||||
#define NM_MODEM_MANAGER_MODEM_ADDED "modem-added"
|
||||
|
||||
#define NM_MODEM_MANAGER_MM_DBUS_SERVICE "org.freedesktop.ModemManager1"
|
||||
#define NM_MODEM_MANAGER_MM_DBUS_PATH "/org/freedesktop/ModemManager1"
|
||||
#define NM_MODEM_MANAGER_MM_DBUS_INTERFACE "org.freedesktop.ModemManager1"
|
||||
|
||||
typedef struct _NMModemManager NMModemManager;
|
||||
typedef struct _NMModemManagerClass NMModemManagerClass;
|
||||
|
||||
|
@@ -105,10 +105,12 @@ typedef enum { /*< underscore_name=nm_modem_state >*/
|
||||
|
||||
struct _NMModemPrivate;
|
||||
|
||||
typedef struct {
|
||||
struct _NMModem {
|
||||
GObject parent;
|
||||
struct _NMModemPrivate *_priv;
|
||||
} NMModem;
|
||||
};
|
||||
|
||||
typedef struct _NMModem NMModem;
|
||||
|
||||
typedef struct {
|
||||
GObjectClass parent;
|
||||
|
Reference in New Issue
Block a user