Use a specific device ?

Jean-Christian de Rivaz jc at eclis.ch
Thu May 28 07:41:50 PDT 2015


Le 28. 05. 15 12:17, Aleksander Morgado a écrit :
> On Wed, May 27, 2015 at 1:34 AM, Jean-Christian de Rivaz <jc at eclis.ch> wrote:
>> Le 27. 05. 15 01:14, Dan Williams a écrit :
>>> Like I said on the NM lists, I'd rather have ModemManager read the
>>> symlinks and advertise *those* over D-Bus instead of adding new
>>> MM-specific tagging stuff to ModemManager itself.  Seems like a more
>>> generic solution to me than "magic" tags.  It also ensures that you
>>> cannot use the same tag for multiple devices.
>>>
>> Just for curiosity, how did you plan to find the symbolic link that point to
>> the real ttyACMx ?
> That's an interesting question; as udev won't notify via events about
> the links it creates (right?). We could list all files within /dev and
> then use realpath() to see if any link file points to the real tty
> device path, but that is too much I think. Tagging the specific device
> in udev with a new "ID_MM_DEVICE_TAG" that is then exposed in DBus
> could be much simpler to implement.
>
> But anyway, at the end, the setting of the udev rule (either tag or
> link) depends directly on a developer or administrator setting it for
> a specific use case. I wonder if that use case cannot be fulfilled
> automatically in some other way. E.g. if you know you'll have to
> support CDMA and GSM/UMTS modems, you could create 2 different
> connection settings in NM that are not bound to any specific device,
> and once the modem shows up in ModemManager decide in runtime which of
> the settings should get applied to the modem to get it connected. CDMA
> vs GSM/UMTS is an obvious thing, maybe you have to setup more runtime
> checkes, but I don't think it should be impossible.
>

What's more complicated for a user like me is that the big picture 
includes two different projects: ModemManager and NetoworkManager. 
Whenever MM should provides more informations on D.Bus, or NM should 
have more runtime check, this mode of operation is actually poorly 
documented and I take a long time trying to understand before posting in 
the respective mailing list. Thankfully I got a working trick from the 
NM mailing list.

My proposition got that way:
1) By default ModemManager identify the modem on D-Bus using the device 
name (e.g. ttyACMx).
2) If ID_MM_DEVICE_TAG is provided from udev rules, then ModemManager 
use ID_MM_DEVICE_TAG value to identify the modem on D-Bus instead of 1).
3) If (choose a method here) then ModemManager use the modem ID / SIM ID 
to identify the modem on D-Bus instead of 1) and 2).

Jean-Christian



More information about the ModemManager-devel mailing list