This was on an embedded system, so I moved over to a desktop system - usb_modeswitch works there, so I made sure to have the same version and config files on the embedded device - still no luck there. So I started experimenting on the desktop. I removed the udev rule that runs "usb_modeswitch %b/%k" and saw that the modem did not switch, that let me try at the command line. Using usb_modeswitch -v 0af0 -p d033 showed the same bad behavior I had seen on the embedded device. Then I replaced the udev rule, but instead of running usb_modeswitch, I replaced it with a program that saves the args so I could see them. After triggering the rule, I looked at the args, and it was '/1-2.2', so I ran "usb_modeswitch /1-2.2", and it complained about a missing vid/pid. I went on to look at the source code, and I'm very confused because I don't see how it could ever work with that argument.
So, what's happening here? Why does this udev rule work?
Code: Select all
# Option HSO device
ATTR{idVendor}=="0af0", ATTR{idProduct}=="d033", RUN+="usb_modeswitch '%b/%k'"