Advantages of Interrupt-In vs polling via Control-Transfers?
Posted: Sun Nov 09, 2008 3:29 pm
Hi,
I'm currently looking at the RemoteSensor example because I want to create a device which should send data to the host "itself".
I'm wondering where the advantages of an Interrupt-In are compared to simply polling the device through Control-Transfers.
Looking at the host-code in the example:
Couldn't I simply use a controltransfer instead of usb_interrupt_read and get the same result?
Regards,
Chris
I'm currently looking at the RemoteSensor example because I want to create a device which should send data to the host "itself".
I'm wondering where the advantages of an Interrupt-In are compared to simply polling the device through Control-Transfers.
Looking at the host-code in the example:
Code: Select all
/* wait for interrupt, set timeout to more than a week */
nBytes = usb_interrupt_read(handle, USB_ENDPOINT_IN | 1 , (char *)buffer, sizeof(buffer), 700000 * 1000);
if(nBytes < 0){
logPrintf("error in USB interrupt read: %s\n", usb_strerror());
goto usbErrorOccurred;
}
Couldn't I simply use a controltransfer instead of usb_interrupt_read and get the same result?
Regards,
Chris