Haven't compiled this yet, but this is the idea. Set a timeout so the
subprocess checks 5 times while the main loop waits. I know get_state works
on rev 4 modems because I get the line speed reported, so it should
eventually see the modem sync and the forked process should die. I probably
still need some counter and limit code for the forked process to die if all
goes wrong or it will sit there logging every 12 seconds forever?
@@ -1083,8 +1262,8 @@
int ret;
unsigned char lbuf[6];
- /* We can try reading the int endpoint */
- ret = pusb_endpoint_read(ep_int, lbuf, sizeof(lbuf), 0);
+ /* We can try reading the int endpoint 5 times */
+ ret = pusb_endpoint_read(ep_int, lbuf, sizeof(lbuf), timeout*200);
/* Ok we failed, perhaps the device has been disconnected */
if(ret < 0 && errno == ENODEV) {
@@ -1093,9 +1272,9 @@
}
/* Just a failure -- report the error and then wait in the waiting loop
*/
- if(ret < 0)
- report(0, REPORT_ERROR, "Error reading interrupts\n");
-
+ /*if(ret < 0) */
+ /* report(0, REPORT_ERROR, "Error reading interrupts\n"); */
+
/*
* Perhaps the reading is a success, in this case the buffer is 6 bytes
* long and the content of the buffer is the line state as described
@@ -1139,6 +1318,7 @@
/* Get the state from the device */
get_state(fdusb, buf);
+ print_state(buf);
if(memcmp(buf, prevbuf, TOTAL)) {
Liste de diffusion modem ALCATEL SpeedTouch USB
Pour se d�sinscrire : mailto:[EMAIL PROTECTED]