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 "nm-bt-error.h"
|
||||||
#include "platform/nm-platform.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 "introspection/org.freedesktop.NetworkManager.Device.Bluetooth.h"
|
||||||
|
|
||||||
#include "devices/nm-device-logging.h"
|
#include "devices/nm-device-logging.h"
|
||||||
_LOG_DECLARE_SELF(NMDeviceBt);
|
_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 (
|
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_CONNECT_SIGNALS |
|
||||||
G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
|
G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
|
||||||
NULL,
|
NULL,
|
||||||
MM_DBUS_SERVICE,
|
NM_MODEM_MANAGER_MM_DBUS_SERVICE,
|
||||||
MM_DBUS_PATH,
|
NM_MODEM_MANAGER_MM_DBUS_PATH,
|
||||||
MM_DBUS_INTERFACE,
|
NM_MODEM_MANAGER_MM_DBUS_INTERFACE,
|
||||||
NULL, &error);
|
NULL, &error);
|
||||||
if (priv->mm_proxy) {
|
if (priv->mm_proxy) {
|
||||||
g_signal_connect (priv->mm_proxy, "notify::g-name-owner",
|
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);
|
mm_name_owner_changed (G_OBJECT (priv->mm_proxy), NULL, self);
|
||||||
} else {
|
} else {
|
||||||
_LOGW (LOGD_MB, "Could not create proxy for '%s': %s",
|
_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);
|
g_clear_error (&error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -24,8 +24,6 @@
|
|||||||
#include "devices/nm-device.h"
|
#include "devices/nm-device.h"
|
||||||
#include "nm-bluez-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_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(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))
|
#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);
|
guint32 nm_device_bt_get_capabilities (NMDeviceBt *device);
|
||||||
|
|
||||||
|
struct _NMModem;
|
||||||
|
|
||||||
gboolean nm_device_bt_modem_added (NMDeviceBt *device,
|
gboolean nm_device_bt_modem_added (NMDeviceBt *device,
|
||||||
NMModem *modem,
|
struct _NMModem *modem,
|
||||||
const char *driver);
|
const char *driver);
|
||||||
|
|
||||||
#endif /* __NETWORKMANAGER_DEVICE_BT_H__ */
|
#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 */
|
/* If there is no current owner right away, ensure we poke to get one */
|
||||||
g_dbus_connection_call (priv->dbus_connection,
|
g_dbus_connection_call (priv->dbus_connection,
|
||||||
"org.freedesktop.ModemManager1",
|
NM_MODEM_MANAGER_MM_DBUS_SERVICE,
|
||||||
"/org/freedesktop/ModemManager1",
|
NM_MODEM_MANAGER_MM_DBUS_PATH,
|
||||||
DBUS_INTERFACE_PEER,
|
DBUS_INTERFACE_PEER,
|
||||||
"Ping",
|
"Ping",
|
||||||
NULL,
|
NULL,
|
||||||
|
@@ -34,6 +34,10 @@
|
|||||||
|
|
||||||
#define NM_MODEM_MANAGER_MODEM_ADDED "modem-added"
|
#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 _NMModemManager NMModemManager;
|
||||||
typedef struct _NMModemManagerClass NMModemManagerClass;
|
typedef struct _NMModemManagerClass NMModemManagerClass;
|
||||||
|
|
||||||
|
@@ -105,10 +105,12 @@ typedef enum { /*< underscore_name=nm_modem_state >*/
|
|||||||
|
|
||||||
struct _NMModemPrivate;
|
struct _NMModemPrivate;
|
||||||
|
|
||||||
typedef struct {
|
struct _NMModem {
|
||||||
GObject parent;
|
GObject parent;
|
||||||
struct _NMModemPrivate *_priv;
|
struct _NMModemPrivate *_priv;
|
||||||
} NMModem;
|
};
|
||||||
|
|
||||||
|
typedef struct _NMModem NMModem;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
GObjectClass parent;
|
GObjectClass parent;
|
||||||
|
Reference in New Issue
Block a user