Bug 1313 - USB data not fully returned.
Summary: USB data not fully returned.
Status: CONFIRMED
Alias: None
Product: libsigrok
Classification: Unclassified
Component: Common: USB handling code (show other bugs)
Version: 0.5.0
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-15 07:54 CEST by marchelh
Modified: 2018-10-15 07:54 CEST (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description marchelh 2018-10-15 07:54:22 CEST
There is a behavior that I think must be solved in the transport implementation regarding returning data from the device. 

When asking data from the device and a expected data lengt is provided, the USB implementation only returns the USB device level block-lengt to the requester. Although the USB implementation already knows that there is more data available. 

For example, when requesting data with sr_scpi_read_data() where I give an maxlen of 356, the buffer gets filed with only 64 bytes of data. Now we need to iterate to retrieve the rest of the data, which I think should not be the responsibility of the high level driver. 

The low level USB implementation knows the actual complete data size because the variable remaining_length is filed with the correct length that the device complete response.

So I think that the lowlevel USB driver must return all data requested with the maxlen property, and either give an timeout when no or incomplete data size is returned.