]> sigrok.org Git - libsigrok.git/commitdiff
scpi: Rephrase buffer resize for free space during SCPI read, add comments
authorGerhard Sittig <redacted>
Sat, 7 Jan 2017 12:08:12 +0000 (13:08 +0100)
committerUwe Hermann <redacted>
Fri, 20 Jan 2017 17:53:43 +0000 (18:53 +0100)
Routine sr_scpi_get_data() checks for free space in the receive buffer,
and resizes the buffer when free space drops below a threshold. The
previous logic assumed that the resize and the read logic would interact
in some specific way to achieve the desired operation.

Adjust the buffer resize such that more free space is pre-allocated, yet
the payload size of the buffer is not affected. This eliminates the
dependency of the optional resize logic from subsequent activity for
reception of data that is non-optional.

Add comments while we are here, outline the steps taken in the
sr_scpi_get_data() routine.


No differences found