I have the above modem
I want to run it from a sparkfun USB host shield board on an Arduino Duemilanove board
What part of usb_modeswitch actually does the switch ? Can I duplicate that in C++?
I know that "HuwaeMode=1" switches it from the reference file but I don't know how to send this to the modem when it first boots
There is also a AT^DIAG= type switch which is supposed to switch the CD mode off permanently but I have not had success as yet
Can anybody help please
Firstly, I recommend using the bulk message method; the control transfer mode was used for some very early Huawei modems only. See all Huawei configs in the data package.
To mode-switch a Huawei device you'd have to
1. detach the previous driver (almost always usb-storage)
2. claim the first interface
3. send the bulk message to it
This may even be possible via sysfs attributes, but the usb_modeswitch core tool is intended to be independent of the Unix flavor, thus using libusb.
To mode-switch a Huawei device you'd have to
1. detach the previous driver (almost always usb-storage)
2. claim the first interface
3. send the bulk message to it
This may even be possible via sysfs attributes, but the usb_modeswitch core tool is intended to be independent of the Unix flavor, thus using libusb.
It's not as complicated as it may seem.
The steps I described translate to one function each in libusb.
See the docs:
1. detach driver - reference
2. claim interface - reference
3. send bulk message - reference
To get the device handle used in these operations, you have to conduct a search on the USB bus once and pick your device. Just start working with the example - reference
For mode switching in Huawei devices, the only interface to talk to is the first one (no. 0).
The steps I described translate to one function each in libusb.
See the docs:
1. detach driver - reference
2. claim interface - reference
3. send bulk message - reference
To get the device handle used in these operations, you have to conduct a search on the USB bus once and pick your device. Just start working with the example - reference
For mode switching in Huawei devices, the only interface to talk to is the first one (no. 0).