Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7068145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:17:18+00:00 2026-05-28T05:17:18+00:00

To read data from an opened USB connection one uses UsbDeviceConnection bulkTransfer method. I

  • 0

To read data from an opened USB connection one uses UsbDeviceConnection bulkTransfer method.

I have the situation that after sending a request the routine should read all incoming data, which can be just 8 bytes or even 300+ bytes.

The problem is that bulkTransfer does not read all the bytes for some reason – it just returns with some bytes while there could be more to come.

Is it better to write a loop around bulkTransfer until there is no more data, or increase the timeout, or possibly there is another approach.

What would be the best way to handle this?

I tried the loop approach and I am surprised that it only reads about 10-20 bytes each time with a timeout of even 1second. I am sure there is more data already available, don’t know why it does not read more at a time.

Does it matter which buffersize one uses – many examples have 4096 but how does changing this influence the reading of data?

Many thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:17:19+00:00Added an answer on May 28, 2026 at 5:17 am

    If the device sends 10 bytes at a time and does so repeatedly to finish the 300+ bytes, you still only get these 10-byte chunks each time you read with bulk transfer.

    In other words, the method does not wait to fill up your buffer. It returns as soon as there is something. So if you really want to collect the entire 300+ byte response, you do need to loop.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code that uses Sequence objects to read data from a
I read data from a mysql database that has is filled by php scripts.
I have to read data from some files and insert the data into different
I am trying to read data from an RS-232 port. Does anyone have an
Error: Unable to read data from the transport connection: A blocking operation was interrupted
I have to make a view that shows unrelated data from multiple tables. I
I have a process that will be called rather frequently from cron to read
I need to have a page on my website that when opened will read
I have a xml file that needs to be read from many many times.
I'm trying to read data from a.csv file to ouput it on a webpage

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.