Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:kssingvo
huawei_umtsmodem
huaweiAktBbo-with_argv.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File huaweiAktBbo-with_argv.patch of Package huawei_umtsmodem
--- huawei_umtsmodem-1.0.0/huaweiAktBbo.c.orig 2008-06-26 16:52:28.000000000 +0200 +++ huawei_umtsmodem-1.0.0/huaweiAktBbo.c 2008-06-26 16:57:37.000000000 +0200 @@ -19,6 +19,7 @@ #include "libusb_augment.h" #endif + struct usb_dev_handle *devh; void release_usb_device(int dummy) { @@ -85,10 +86,11 @@ int main(int argc, char **argv) { #endif usb_init(); -// usb_set_debug(255); +#ifdef DEBUG + usb_set_debug(255); +#endif usb_find_busses(); usb_find_devices(); -/* if (argc!=3) { printf("usage: %s vendorID productID\n", argv[0]); printf("ID numbers of currently attached devices:\n"); @@ -105,10 +107,11 @@ int main(int argc, char **argv) { printf("invalid product id\n"); exit(1); } -*/ printf("Looking up for HUAWEI modem and switching modem to BBO 06\n"); +#if 0 vendor = 0x12d1; product = 0x1003; +#endif dev = find_device(vendor, product); assert(dev); @@ -136,46 +139,53 @@ int main(int argc, char **argv) { */ // BBO typ 1 = DEVICE ret = usb_get_descriptor(devh, 0x0000001, 0x0000000, buf, 0x0000012); -//printf("1 get descriptor returned %d, bytes: ", ret); -//print_bytes(buf, ret); -//printf("\n"); +#ifdef DEBUG + printf("1 get descriptor returned %d, bytes: ", ret); + print_bytes(buf, ret); + printf("\n"); +#endif usleep(1*1000); + // BBO typ 2 = CONFIGURATION ret = usb_get_descriptor(devh, 0x0000002, 0x0000000, buf, 0x0000009); -//printf("2 get descriptor returned %d, bytes: ", ret); -//print_bytes(buf, ret); -//printf("\n"); +#ifdef DEBUG + printf("2 get descriptor returned %d, bytes: ", ret); + print_bytes(buf, ret); + printf("\n"); +#endif usleep(1*1000); + // BBO typ 2 = CONFIGURATION ret = usb_get_descriptor(devh, 0x0000002, 0x0000000, buf, 0x0000020); -//printf("3 get descriptor returned %d, bytes: ", ret); -//print_bytes(buf, ret); -//printf("\n"); +#ifdef DEBUG + printf("3 get descriptor returned %d, bytes: ", ret); + print_bytes(buf, ret); + printf("\n"); +#endif usleep(1*1000); -/* -ret = usb_release_interface(devh, 0); -if (ret != 0) printf("failed to release interface before set_configuration: %d\n", ret); -ret = usb_set_configuration(devh, 0x0000001); -printf("4 set configuration returned %d\n", ret); -ret = usb_claim_interface(devh, 0); -if (ret != 0) printf("claim after set_configuration failed with error %d\n", ret); -ret = usb_set_altinterface(devh, 0); -printf("4 set alternate setting returned %d\n", ret); -usleep(50*1000); -ret = usb_set_altinterface(devh, 0); -printf("5 set alternate setting returned %d\n", ret); -usleep(62*1000); -*/ + +// +// ret = usb_release_interface(devh, 0); +// if (ret != 0) printf("failed to release interface before set_configuration: %d\n", ret); +// ret = usb_set_configuration(devh, 0x0000001); +// printf("4 set configuration returned %d\n", ret); +// ret = usb_claim_interface(devh, 0); +// if (ret != 0) printf("claim after set_configuration failed with error %d\n", ret); +// ret = usb_set_altinterface(devh, 0); +// printf("4 set alternate setting returned %d\n", ret); +// usleep(50*1000); +// ret = usb_set_altinterface(devh, 0); +// printf("5 set alternate setting returned %d\n", ret); +// usleep(62*1000); +// ret = usb_control_msg(devh, USB_TYPE_STANDARD + USB_RECIP_DEVICE, USB_REQ_SET_FEATURE, 00000001, 0, buf, 0, 1000); printf("4 set feature request returned %d\n", ret); -/* - ret = usb_release_interface(devh, 0); - assert(ret == 0); -*/ +// ret = usb_release_interface(devh, 0); +// assert(ret == 0); ret = usb_close(devh); assert(ret == 0); printf("Switched:OK\n"); - printf("You've got ttyUSB0 ttyUSB1 ... (via usbserial vendor=0x12d1 product=0x1003)\n"); + printf("You've got ttyUSB0 ttyUSB1 ... (via usbserial vendor=0x%x product=0x%x)\n", vendor, product); printf("Check /sys/bus/usb-serial/devices\n"); return 0; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor