Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Hardware & Devices
  4. When to call WinUsb_FlushPipe

When to call WinUsb_FlushPipe

Scheduled Pinned Locked Moved Hardware & Devices
question
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • _ Offline
    _ Offline
    __John_
    wrote on last edited by
    #1

    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

    J 1 Reply Last reply
    0
    • _ __John_

      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

      J Offline
      J Offline
      Jochen Arndt
      wrote on last edited by
      #2

      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.

      _ 1 Reply Last reply
      0
      • J Jochen Arndt

        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.

        _ Offline
        _ Offline
        __John_
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups