Re: How nm-modem-probe work?



On Fri, 2009-11-20 at 15:13 +0800, 代尔欣 wrote:
> Hi all,
>    I have a HuaWei EM770 modem. Through add rules in udev I can make
> NM0.7.1.998 found it and work. But I have to set the ID_NM_MODEM_GSM=1
> in the rules like 77-nm-zte-port-types.rules. This make
> udevadm_get_modem_capabilities(Do not have libudev support) return
> correct bits. But in 77-nm-probe-modem-capabilities.rules, it does not
> set any related environment value and just call nm-modem-probe
> instead. I suppose nm-modem-probe set related environment value? But
> from the codes nm-modem-probe.c, It seems not. How this work? Need
> libudev support?

Yes, nm-modem-probe sets the capabilities.  It opens the port and asks
the modem what it's capabilities are using standard AT commands.  You'll
very likely need libudev for this to work.  You can debug the modem
probing by adding "--verbose --log /tmp/probe.log" to the end of the
udev rules file line like so:

SUBSYSTEM=="tty", SUBSYSTEMS=="usb", ATTRS{idVendor}=="?*",
ATTRS{idProduct}=="?*", IMPORT{program}="nm-modem-probe --vid 0x
$attr{idVendor} --pid 0x$attr{idProduct} --usb-interface
$env{NM_MODEM_USB_INTERFACE_NUMBER} --driver $env{NM_MODEM_DRIVER}
--delay 1000 --timeout 5000 --export --verbose --log /tmp/probe.log
$tempnode", GOTO="nm_modem_probe_end"

and then looking at the output of /tmp/probe.log to figure out why the
probing is not working correctly.

Dan




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