On Fri, Jan 13, 2017 at 01:30 +0100, Stefan Bruens wrote: > > Hi, > > I have cleaned up the serial layer for SCPI, to make it work with SCPI > definite length block requests.
Unfortunately those changes conflict with the HMO2524 patches that are somewhere in the queue for review and hopefully merging. To test your changes with the maximum number of channels available, I had to massage them to resolve conflicts. As a byproduct, Uwe might grab a merged set when he finds our changes acceptable. > The first patch is just generic cleanup. > > The second patch removes the newline stripping from the serial layer, as it > corrupts data for the binary block requests, and is not necessary, as newline > stripping is done in sr_scpi_get_string in a central place. Using a 'char' variable to store number values doesn't look right to me. :) I've changed the type to 'int' when I rebased. If you are desperate after saving the last byte available, you know where to find boolean data types. Note that using a non-int type can generate more expensive code on some machines, which consumes more bytes than you saved in a struct that's held just once. > The third patch factors out the actual data fetching and timeout handling > from > sr_scpi_get_data, and calls it from the appropriate places in > sr_scpi_get_data > and sr_scpi_get_block. As the latter requires partial and nonblocking > fetches, > it can not call sr_scpi_get_data. When I rebased that one, I changed some size related data types, silenced a compiler warning, and updated the comments that have become stale. > Please review and pull the changes from: > > https://github.com/StefanBruens/libsigrok/tree/fix_scpi_get_block_for_serial > > The changes have been tested with hameg_hmo/HMO1002 over serial and network. Can you check whether you agree with my conflict resolution? See the three commits on top of my former hameg-hmo-digital16-rebased set of commits: git://repo.or.cz/libsigrok/gsi.git scpi-serial-get-block-rebased For those who want to view the changes with a web browser: http://repo.or.cz/libsigrok/gsi.git/shortlog/refs/heads/scpi-serial-get-block-rebased Tested with HMO2524 over USB, which used to stall and timeout before, waiting for an end-of-line terminator that won't occur for binary sample downloads. Stefan's changes fix that issue. http://i.imgur.com/xsrokj2.png The timestamps might have suffered when I applied some magic to keep the attribution in place (keeping Stefan as the author when 'git am' would not cleanly apply the patches). Hopefully you can excuse my surgery. :) The work for the fix was done by Stefan. Should errors have slipped in during rebase then those are mine. There is another open issue that the current implementation of sr_scpi_get_block() is one blocking call for whatever length the scope's capture might occupy. The rigol-ds driver is said to implement a more appropriate approach that does not starve other components, which should become common logic (when possible) and get shared with hameg-hmo. Are you going to work on that one, too, Stefan? I won't any time soon. virtually yours Gerhard Sittig -- If you don't understand or are scared by any of the above ask your parents or an adult to help you. ------------------------------------------------------------------------------ Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of Intel Parallel Studio XE. Training and support from Colfax. Order your platform today. http://sdm.link/xeonphi _______________________________________________ sigrok-devel mailing list sigrok-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sigrok-devel