Re: [PATCH] Fix for Blueman modem being ignored



> Currently when a modem device registered by Blueman is connected,
> NetworkManager reports that there is no associated bluetooth device.
> 
> The if statement responsible for this ought to be reporting an error and
> returning if the driver is named, but not named "bluetooth".
> 
> Unfortunately, the true result of strcmp(), zero, has been flipped,
> meaning only the device name "bluetooth" isn't acceptable as a bluetooth
> device.
> 
> The solution to this was found by Andrew Guskoff, he describes it here;
> 
> https://bbs.archlinux.org/viewtopic.php?id=147880
> 
> I picked it up from the Ubuntu/ Arch Linux bug report;
> 
> https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/583728
> 
> This fixes the problem for me with NetworkManager 0.9.4 (Ubuntu 12.04)
> and a Nokia N900 phone, Andrew (obviously) and another user who reported
> trying it on the log.
> 
> I've attached a patch I created against a checkout from the
> NetworkManager git repository.
> 

The current logic in the code is the proper one as far as I can tell.
The logic goes like:

 (1) A new modem is notified to NM.

 (2) NM tries to match the new modem with the current list of NMDeviceBt
objects. The NMDeviceBt associated with the new modem should grab the modem:

	/* Give Bluetooth DUN devices first chance to claim the modem */
	for (iter = priv->devices; iter; iter = g_slist_next (iter)) {
		if (nm_device_get_device_type (iter->data) == NM_DEVICE_TYPE_BT) {
			if (nm_device_bt_modem_added (NM_DEVICE_BT (iter->data), modem, driver))
				return;
		}
	}

  (3) If no bluetooth device (NMDeviceBt) grabbed the modem, and the
modem comes from a bluetooth device (it reports a "bluetooth" driver),
then we ignore it:


	/* If it was a Bluetooth modem and no bluetooth device claimed it, ignore
	 * it.  The rfcomm port (and thus the modem) gets created automatically
	 * by the Bluetooth code during the connection process.
	 */
	if (driver && !strcmp (driver, "bluetooth")) {
		nm_log_info (LOGD_MB, "ignoring modem '%s' (no associated Bluetooth
device)", ip_iface);
		return;
	}

  (4) Otherwise, we pick the modem as if it was a non-bluetooth device.

	/* Make the new modem device */
	device = nm_device_modem_new (modem, driver);
	if (device)
		add_device (self, device);


So the thing here is to see why the bluetooth device didn't grab the
modem. Forcing the modem to be treated as a non-bluetooth device is not
really the fix.

Have to say, I currently have the same issue when trying Bluetooth DUN
devices. In my case it's because noone creates bluetooth-specific
settings in NetworkManager, but I'm assuming it's because of some
missing implementation in gnome-control-center (I'm using GNOME3 here).
Is this also your case? Or are you using the network-manager-applet?


-- 
Aleksander


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