Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#139 flush() (and friends) don't.

v2.6
closed-works-for-me
Chris Liechti
None
5
2013-10-17
2013-01-06
spresse1
No

Attempted to use flush to empty out the buffers on a device (that is, read and discard all data). It didn't. After a significant wait then a call to flush, data was still left in the buffers. Flush either needs to be more clear about the fact that it _ONLY_ discards internal buffers or needs to actually deal with OS level buffers.

OS: Sci Liunx 6
Python: 2.6.6

Discussion

  • Chris Liechti
    Chris Liechti
    2013-05-31

    Do you refer to flushInput()? as flush() is waiting to the output, not the input.

     
  • Chris Liechti
    Chris Liechti
    2013-10-11

    • status: open --> pending-works-for-me
    • assigned_to: Chris Liechti
    • Group: --> v1.0 (example)
     
  • Chris Liechti
    Chris Liechti
    2013-10-11

    flushInput() actually calls the OS function to discard input (the same is also true for flushOutput()/flush()).

    I suspect that flush() was called (which is an alias for flushOutput()) and the user expected that flushInput() is executed, which isn't.

     
  • Chris Liechti
    Chris Liechti
    2013-10-17

    • status: pending-works-for-me --> closed-works-for-me
     
  • Chris Liechti
    Chris Liechti
    2013-10-17

    After testing with different USB-serial adapters, i've also seen one that does not discard all the input. I suspect that this is a bug in the driver of that specific device, so that the OS buffers probably are cleared but the IC on the device itself also has a buffer that is not cleared. That same device works as expected on Windows.

     
  • Chris Liechti
    Chris Liechti
    2013-10-17

    • Group: v1.0 (example) --> v2.6