When to call WinUsb_FlushPipe
-
-
Do I need to call WinUsb_FlushPipe after every write, if I need to be sure all the data is sent immediately? Or is it only needed under certain conditions? Thanks.
“If I had asked people what they wanted, they would have said faster horses.” ― Henry Ford
Flushing will discard cached data in the receive buffer. This is probably not what you want during normal operation. It is usually done upon errors. As far as I know data is always send immediately. But the USB device may not read it immediately. You may use the
SHORT_PACKET_TERMINATE
PolicyType to send a zero-length packet after each write request. This may trigger the USB device to read in all data. But before doing this I would check it it is really necessary. -
Flushing will discard cached data in the receive buffer. This is probably not what you want during normal operation. It is usually done upon errors. As far as I know data is always send immediately. But the USB device may not read it immediately. You may use the
SHORT_PACKET_TERMINATE
PolicyType to send a zero-length packet after each write request. This may trigger the USB device to read in all data. But before doing this I would check it it is really necessary.Thanks Jochen, The USB device in question is implemented by me, so I know that ZLP's are not required and under normal operation all packets will be read imediatly (pretty quick anyway). So I should not need to call WinUsb_FlushPipe. Thanks again.
“If I had asked people what they wanted, they would have said faster horses.” ― Henry Ford