|
|
|
|
@ -147,24 +147,26 @@ int cnt, vid, pid;
|
|
|
|
|
rxIndex = ((int)buffer[1] & 0xff) | (((int)buffer[0] & 0xff) << 8);
|
|
|
|
|
|
|
|
|
|
if(rxIndex) { // if we have new data?
|
|
|
|
|
// get the new char and print it
|
|
|
|
|
rq = rqGetNew;
|
|
|
|
|
// advance the new char pointer...
|
|
|
|
|
rq = rqAdvance;
|
|
|
|
|
cnt = usb_control_msg(handle, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_IN, rq[0], rq[1], rq[2], buffer, sizeof(buffer), 5000);
|
|
|
|
|
if(cnt < 0){
|
|
|
|
|
fprintf(stderr, "\nUSB error in iteration ?!?: %s\n", usb_strerror());
|
|
|
|
|
}
|
|
|
|
|
rxIndex = ((int)buffer[1] & 0xff) | (((int)buffer[0] & 0xff) << 8);
|
|
|
|
|
fprintf(stderr, "%c", rxIndex);
|
|
|
|
|
|
|
|
|
|
// advance the new char pointer...
|
|
|
|
|
rq = rqAdvance;
|
|
|
|
|
// get the new char and print it
|
|
|
|
|
rq = rqGetNew;
|
|
|
|
|
cnt = usb_control_msg(handle, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_IN, rq[0], rq[1], rq[2], buffer, sizeof(buffer), 5000);
|
|
|
|
|
if(cnt < 0){
|
|
|
|
|
fprintf(stderr, "\nUSB error in iteration ?!?: %s\n", usb_strerror());
|
|
|
|
|
}
|
|
|
|
|
rxIndex = ((int)buffer[1] & 0xff) | (((int)buffer[0] & 0xff) << 8);
|
|
|
|
|
if(rxIndex != 0 && (rxIndex & 0xff) != 0xff){
|
|
|
|
|
fprintf(stderr, "%c", rxIndex);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
usleep(10000);
|
|
|
|
|
usleep(1000);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
usage();
|
|
|
|
|
|