[PATCH 2/8] modem-manager: rename old interface symbols



The new ModemManager comes with its own headers, and defines its own symbols to
name e.g. each interface. In order not to collide with the new ones, rename the
existing ones with a 'MM_OLD_DBUS' prefix instead of just 'MM_DBUS'.
---
 src/modem-manager/nm-modem-cdma.c    |  6 +++---
 src/modem-manager/nm-modem-generic.c | 18 +++++++++---------
 src/modem-manager/nm-modem-gsm.c     |  8 ++++----
 src/modem-manager/nm-modem-manager.c | 16 ++++++++--------
 src/modem-manager/nm-modem-types.h   | 35 +++++++++++++++++------------------
 5 files changed, 41 insertions(+), 42 deletions(-)

diff --git a/src/modem-manager/nm-modem-cdma.c b/src/modem-manager/nm-modem-cdma.c
index 3002e79..73c87c2 100644
--- a/src/modem-manager/nm-modem-cdma.c
+++ b/src/modem-manager/nm-modem-cdma.c
@@ -110,7 +110,7 @@ do_connect (NMModemCdma *self)
 	NMModemCdmaPrivate *priv = NM_MODEM_CDMA_GET_PRIVATE (self);
 	DBusGProxy *proxy;
 
-	proxy = nm_modem_generic_get_proxy (NM_MODEM_GENERIC (self), MM_DBUS_INTERFACE_MODEM_SIMPLE);
+	proxy = nm_modem_generic_get_proxy (NM_MODEM_GENERIC (self), MM_OLD_DBUS_INTERFACE_MODEM_SIMPLE);
 	priv->call = dbus_g_proxy_begin_call_with_timeout (proxy,
 	                                                   "Connect", stage1_prepare_done,
 	                                                   self, NULL, 120000,
@@ -178,7 +178,7 @@ act_stage1_prepare (NMModem *modem,
 		if (enabled)
 			do_connect (self);
 		else {
-			proxy = nm_modem_generic_get_proxy (NM_MODEM_GENERIC (modem), MM_DBUS_INTERFACE_MODEM);
+			proxy = nm_modem_generic_get_proxy (NM_MODEM_GENERIC (modem), MM_OLD_DBUS_INTERFACE_MODEM);
 			dbus_g_proxy_begin_call_with_timeout (proxy,
 			                                      "Enable", stage1_enable_done,
 			                                      modem, NULL, 20000,
@@ -318,7 +318,7 @@ deactivate (NMModem *modem, NMDevice *device)
 	if (priv->call) {
 		DBusGProxy *proxy;
 
-		proxy = nm_modem_generic_get_proxy (NM_MODEM_GENERIC (modem), MM_DBUS_INTERFACE_MODEM_SIMPLE);
+		proxy = nm_modem_generic_get_proxy (NM_MODEM_GENERIC (modem), MM_OLD_DBUS_INTERFACE_MODEM_SIMPLE);
 		dbus_g_proxy_cancel_call (proxy, priv->call);
 		priv->call = NULL;
 	}
diff --git a/src/modem-manager/nm-modem-generic.c b/src/modem-manager/nm-modem-generic.c
index 0214f1c..df621d5 100644
--- a/src/modem-manager/nm-modem-generic.c
+++ b/src/modem-manager/nm-modem-generic.c
@@ -60,7 +60,7 @@ nm_modem_generic_get_proxy (NMModemGeneric *self,
 
 	/* Default to the default interface. */
 	if (interface == NULL)
-		interface = MM_DBUS_INTERFACE_MODEM;
+		interface = MM_OLD_DBUS_INTERFACE_MODEM;
 
 	if (interface && !strcmp (interface, DBUS_INTERFACE_PROPERTIES))
 		return priv->props_proxy;
@@ -116,7 +116,7 @@ query_mm_enabled (NMModemGeneric *self)
 	dbus_g_proxy_begin_call (NM_MODEM_GENERIC_GET_PRIVATE (self)->props_proxy,
 	                         "Get", get_mm_enabled_done,
 	                         self, NULL,
-	                         G_TYPE_STRING, MM_DBUS_INTERFACE_MODEM,
+	                         G_TYPE_STRING, MM_OLD_DBUS_INTERFACE_MODEM,
 	                         G_TYPE_STRING, "Enabled",
 	                         G_TYPE_INVALID);
 }
@@ -144,7 +144,7 @@ set_mm_enabled (NMModem *self, gboolean enabled)
 	 * toggle rfkill status of the WWAN modem.
 	 */
 	dbus_g_proxy_begin_call (nm_modem_generic_get_proxy (NM_MODEM_GENERIC (self),
-	                                                     MM_DBUS_INTERFACE_MODEM),
+	                                                     MM_OLD_DBUS_INTERFACE_MODEM),
 	                         "Enable", set_mm_enabled_done,
 	                         self, NULL,
 	                         G_TYPE_BOOLEAN, enabled,
@@ -245,7 +245,7 @@ static_stage3_ip4_config_start (NMModem *self,
 	priv = NM_MODEM_GENERIC_GET_PRIVATE (self);
 
 	priv->call = dbus_g_proxy_begin_call (nm_modem_generic_get_proxy (NM_MODEM_GENERIC (self),
-	                                                                  MM_DBUS_INTERFACE_MODEM),
+	                                                                  MM_OLD_DBUS_INTERFACE_MODEM),
 	                                      "GetIP4Config", static_stage3_done,
 	                                      self, NULL,
 	                                      G_TYPE_INVALID);
@@ -275,7 +275,7 @@ disconnect (NMModem *self,
             gboolean warn)
 {
 	dbus_g_proxy_begin_call (nm_modem_generic_get_proxy (NM_MODEM_GENERIC (self),
-	                                                     MM_DBUS_INTERFACE_MODEM),
+	                                                     MM_OLD_DBUS_INTERFACE_MODEM),
 	                         "Disconnect",
 	                         disconnect_done,
 	                         GUINT_TO_POINTER (warn),
@@ -317,7 +317,7 @@ modem_properties_changed (DBusGProxy *proxy,
 	GValue *value;
 	NMModemState new_state;
 
-	if (strcmp (interface, MM_DBUS_INTERFACE_MODEM))
+	if (strcmp (interface, MM_OLD_DBUS_INTERFACE_MODEM))
 		return;
 
 	value = g_hash_table_lookup (props, "Enabled");
@@ -378,12 +378,12 @@ constructor (GType type,
 
 	bus = nm_dbus_manager_get_connection (priv->dbus_mgr);
 	priv->proxy = dbus_g_proxy_new_for_name (bus,
-	                                         MM_DBUS_SERVICE,
+	                                         MM_OLD_DBUS_SERVICE,
 	                                         nm_modem_get_path (NM_MODEM (object)),
-	                                         MM_DBUS_INTERFACE_MODEM);
+	                                         MM_OLD_DBUS_INTERFACE_MODEM);
 
 	priv->props_proxy = dbus_g_proxy_new_for_name (bus,
-	                                               MM_DBUS_SERVICE,
+	                                               MM_OLD_DBUS_SERVICE,
 	                                               nm_modem_get_path (NM_MODEM (object)),
 	                                               DBUS_INTERFACE_PROPERTIES);
 	dbus_g_object_register_marshaller (_nm_marshal_VOID__STRING_BOXED,
diff --git a/src/modem-manager/nm-modem-gsm.c b/src/modem-manager/nm-modem-gsm.c
index 740e04c..b6d3c85 100644
--- a/src/modem-manager/nm-modem-gsm.c
+++ b/src/modem-manager/nm-modem-gsm.c
@@ -225,7 +225,7 @@ do_connect (NMModemGsm *self)
 	NMModemGsmPrivate *priv = NM_MODEM_GSM_GET_PRIVATE (self);
 	DBusGProxy *proxy;
 
-	proxy = nm_modem_generic_get_proxy (NM_MODEM_GENERIC (self), MM_DBUS_INTERFACE_MODEM_SIMPLE);
+	proxy = nm_modem_generic_get_proxy (NM_MODEM_GENERIC (self), MM_OLD_DBUS_INTERFACE_MODEM_SIMPLE);
 	priv->call = dbus_g_proxy_begin_call_with_timeout (proxy,
 	                                                   "Connect", stage1_prepare_done,
 	                                                   self, NULL, 120000,
@@ -245,7 +245,7 @@ do_enable (NMModemGsm *self)
 	g_return_val_if_fail (NM_IS_MODEM_GSM (self), FALSE);
 
 	NM_MODEM_GSM_GET_PRIVATE (self)->enable_delay_id = 0;
-	proxy = nm_modem_generic_get_proxy (NM_MODEM_GENERIC (self), MM_DBUS_INTERFACE_MODEM);
+	proxy = nm_modem_generic_get_proxy (NM_MODEM_GENERIC (self), MM_OLD_DBUS_INTERFACE_MODEM);
 	dbus_g_proxy_begin_call_with_timeout (proxy,
 	                                      "Enable", stage1_enable_done,
 	                                      self, NULL, 20000,
@@ -298,7 +298,7 @@ handle_enable_pin_required (NMModemGsm *self)
 
 	/* If we do, send it */
 	if (pin) {
-		proxy = nm_modem_generic_get_proxy (NM_MODEM_GENERIC (self), MM_DBUS_INTERFACE_MODEM_GSM_CARD);
+		proxy = nm_modem_generic_get_proxy (NM_MODEM_GENERIC (self), MM_OLD_DBUS_INTERFACE_MODEM_GSM_CARD);
 		dbus_g_proxy_begin_call_with_timeout (proxy,
 		                                      "SendPin", stage1_pin_done,
 		                                      self, NULL, 10000,
@@ -596,7 +596,7 @@ deactivate (NMModem *modem, NMDevice *device)
 	if (priv->call) {
 		DBusGProxy *proxy;
 
-		proxy = nm_modem_generic_get_proxy (NM_MODEM_GENERIC (modem), MM_DBUS_INTERFACE_MODEM_SIMPLE);
+		proxy = nm_modem_generic_get_proxy (NM_MODEM_GENERIC (modem), MM_OLD_DBUS_INTERFACE_MODEM_SIMPLE);
 		dbus_g_proxy_cancel_call (proxy, priv->call);
 		priv->call = NULL;
 	}
diff --git a/src/modem-manager/nm-modem-manager.c b/src/modem-manager/nm-modem-manager.c
index 86bb805..049b5a5 100644
--- a/src/modem-manager/nm-modem-manager.c
+++ b/src/modem-manager/nm-modem-manager.c
@@ -88,12 +88,12 @@ get_modem_properties (DBusGConnection *connection,
 	GValue *value;
 
 	proxy = dbus_g_proxy_new_for_name (connection,
-	                                   MM_DBUS_SERVICE,
+	                                   MM_OLD_DBUS_SERVICE,
 	                                   path,
 	                                   "org.freedesktop.DBus.Properties");
 
 	if (!dbus_g_proxy_call_with_timeout (proxy, "GetAll", 15000, &err,
-	                                     G_TYPE_STRING, MM_DBUS_INTERFACE_MODEM,
+	                                     G_TYPE_STRING, MM_OLD_DBUS_INTERFACE_MODEM,
 	                                     G_TYPE_INVALID,
 	                                     DBUS_TYPE_G_MAP_OF_VARIANT, &props,
 	                                     G_TYPE_INVALID)) {
@@ -240,9 +240,9 @@ poke_modem_cb (gpointer user_data)
 
 	g_connection = nm_dbus_manager_get_connection (priv->dbus_mgr);
 	proxy = dbus_g_proxy_new_for_name (g_connection,
-									   MM_DBUS_SERVICE,
-									   MM_DBUS_PATH,
-									   MM_DBUS_INTERFACE);
+									   MM_OLD_DBUS_SERVICE,
+									   MM_OLD_DBUS_PATH,
+									   MM_OLD_DBUS_INTERFACE);
 
 	call = dbus_g_proxy_begin_call_with_timeout (proxy,
 	                                             "EnumerateDevices",
@@ -293,7 +293,7 @@ modem_manager_appeared (NMModemManager *self, gboolean enumerate_devices)
 	nm_log_info (LOGD_MB, "modem-manager is now available");
 
 	priv->proxy = dbus_g_proxy_new_for_name (nm_dbus_manager_get_connection (priv->dbus_mgr),
-											 MM_DBUS_SERVICE, MM_DBUS_PATH, MM_DBUS_INTERFACE);
+											 MM_OLD_DBUS_SERVICE, MM_OLD_DBUS_PATH, MM_OLD_DBUS_INTERFACE);
 
 	dbus_g_proxy_add_signal (priv->proxy, "DeviceAdded", DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID);
 	dbus_g_proxy_connect_signal (priv->proxy, "DeviceAdded",
@@ -346,7 +346,7 @@ nm_modem_manager_name_owner_changed (NMDBusManager *dbus_mgr,
 	gboolean new_owner_good;
 
 	/* Can't handle the signal if its not from the modem service */
-	if (strcmp (MM_DBUS_SERVICE, name) != 0)
+	if (strcmp (MM_OLD_DBUS_SERVICE, name) != 0)
 		return;
 
 	old_owner_good = (old_owner && strlen (old_owner));
@@ -374,7 +374,7 @@ nm_modem_manager_init (NMModemManager *self)
 					  G_CALLBACK (nm_modem_manager_name_owner_changed),
 					  self);
 
-	if (nm_dbus_manager_name_has_owner (priv->dbus_mgr, MM_DBUS_SERVICE))
+	if (nm_dbus_manager_name_has_owner (priv->dbus_mgr, MM_OLD_DBUS_SERVICE))
 		modem_manager_appeared (self, TRUE);
 	else
 		modem_manager_disappeared (self);
diff --git a/src/modem-manager/nm-modem-types.h b/src/modem-manager/nm-modem-types.h
index b9f6e5b..9fc8dee 100644
--- a/src/modem-manager/nm-modem-types.h
+++ b/src/modem-manager/nm-modem-types.h
@@ -21,15 +21,14 @@
 #ifndef NM_MODEM_TYPES_H
 #define NM_MODEM_TYPES_H
 
-#define MM_DBUS_SERVICE              "org.freedesktop.ModemManager"
-#define MM_DBUS_PATH                 "/org/freedesktop/ModemManager"
-#define MM_DBUS_INTERFACE            "org.freedesktop.ModemManager"
-#define MM_DBUS_INTERFACE_MODEM      "org.freedesktop.ModemManager.Modem"
-#define MM_DBUS_INTERFACE_MODEM_SIMPLE "org.freedesktop.ModemManager.Modem.Simple"
-#define MM_DBUS_INTERFACE_MODEM_CDMA "org.freedesktop.ModemManager.Modem.Cdma"
-
-#define MM_DBUS_INTERFACE_MODEM_GSM_CARD    "org.freedesktop.ModemManager.Modem.Gsm.Card"
-#define MM_DBUS_INTERFACE_MODEM_GSM_NETWORK "org.freedesktop.ModemManager.Modem.Gsm.Network"
+#define MM_OLD_DBUS_SERVICE                     "org.freedesktop.ModemManager"
+#define MM_OLD_DBUS_PATH                        "/org/freedesktop/ModemManager"
+#define MM_OLD_DBUS_INTERFACE                   "org.freedesktop.ModemManager"
+#define MM_OLD_DBUS_INTERFACE_MODEM             "org.freedesktop.ModemManager.Modem"
+#define MM_OLD_DBUS_INTERFACE_MODEM_SIMPLE      "org.freedesktop.ModemManager.Modem.Simple"
+#define MM_OLD_DBUS_INTERFACE_MODEM_CDMA        "org.freedesktop.ModemManager.Modem.Cdma"
+#define MM_OLD_DBUS_INTERFACE_MODEM_GSM_CARD    "org.freedesktop.ModemManager.Modem.Gsm.Card"
+#define MM_OLD_DBUS_INTERFACE_MODEM_GSM_NETWORK "org.freedesktop.ModemManager.Modem.Gsm.Network"
 
 #define MM_MODEM_TYPE_UNKNOWN  0
 #define MM_MODEM_TYPE_GSM      1
@@ -37,17 +36,17 @@
 
 /* Errors */
 
-#define MM_SERIAL_OPEN_FAILED MM_DBUS_INTERFACE_MODEM ".SerialOpenFailed"
-#define MM_SERIAL_SEND_FAILED MM_DBUS_INTERFACE_MODEM ".SerialSendFailed"
-#define MM_SERIAL_RESPONSE_TIMEOUT MM_DBUS_INTERFACE_MODEM ".SerialResponseTimeout"
+#define MM_SERIAL_OPEN_FAILED MM_OLD_DBUS_INTERFACE_MODEM ".SerialOpenFailed"
+#define MM_SERIAL_SEND_FAILED MM_OLD_DBUS_INTERFACE_MODEM ".SerialSendFailed"
+#define MM_SERIAL_RESPONSE_TIMEOUT MM_OLD_DBUS_INTERFACE_MODEM ".SerialResponseTimeout"
 
-#define MM_MODEM_ERROR_GENERAL MM_DBUS_INTERFACE_MODEM ".General"
-#define MM_MODEM_ERROR_OPERATION_NOT_SUPPORTED MM_DBUS_INTERFACE_MODEM ".OperationNotSupported"
+#define MM_MODEM_ERROR_GENERAL MM_OLD_DBUS_INTERFACE_MODEM ".General"
+#define MM_MODEM_ERROR_OPERATION_NOT_SUPPORTED MM_OLD_DBUS_INTERFACE_MODEM ".OperationNotSupported"
 
-#define MM_MODEM_CONNECT_ERROR_NO_CARRIER MM_DBUS_INTERFACE_MODEM ".NoCarrier"
-#define MM_MODEM_CONNECT_ERROR_NO_DIALTONE MM_DBUS_INTERFACE_MODEM ".NoDialtone"
-#define MM_MODEM_CONNECT_ERROR_BUSY MM_DBUS_INTERFACE_MODEM ".Busy"
-#define MM_MODEM_CONNECT_ERROR_NO_ANSWER MM_DBUS_INTERFACE_MODEM ".NoAnswer"
+#define MM_MODEM_CONNECT_ERROR_NO_CARRIER MM_OLD_DBUS_INTERFACE_MODEM ".NoCarrier"
+#define MM_MODEM_CONNECT_ERROR_NO_DIALTONE MM_OLD_DBUS_INTERFACE_MODEM ".NoDialtone"
+#define MM_MODEM_CONNECT_ERROR_BUSY MM_OLD_DBUS_INTERFACE_MODEM ".Busy"
+#define MM_MODEM_CONNECT_ERROR_NO_ANSWER MM_OLD_DBUS_INTERFACE_MODEM ".NoAnswer"
 
 #define MM_MODEM_ERROR "org.freedesktop.ModemManager.Modem.Gsm"
 
-- 
1.8.0



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]