scpi_usbtmc: fix reading of blocks bigger than the 2048 bytes buffer
This commit is contained in:
parent
a53278de01
commit
8ae157d976
|
@ -113,6 +113,11 @@ SR_PRIV int scpi_usbtmc_read_data(void *priv, char *buf, int maxlen)
|
||||||
struct usbtmc_scpi *uscpi = priv;
|
struct usbtmc_scpi *uscpi = priv;
|
||||||
int read_length;
|
int read_length;
|
||||||
|
|
||||||
|
if (uscpi->response_length == MAX_READ_LENGTH
|
||||||
|
&& uscpi->response_bytes_read == uscpi->response_length)
|
||||||
|
if (scpi_usbtmc_read_begin(uscpi) != SR_OK)
|
||||||
|
return SR_ERR;
|
||||||
|
|
||||||
if (uscpi->response_bytes_read >= uscpi->response_length)
|
if (uscpi->response_bytes_read >= uscpi->response_length)
|
||||||
return SR_ERR;
|
return SR_ERR;
|
||||||
|
|
||||||
|
@ -132,6 +137,10 @@ SR_PRIV int scpi_usbtmc_read_complete(void *priv)
|
||||||
{
|
{
|
||||||
struct usbtmc_scpi *uscpi = priv;
|
struct usbtmc_scpi *uscpi = priv;
|
||||||
|
|
||||||
|
if (uscpi->response_length == MAX_READ_LENGTH
|
||||||
|
&& uscpi->response_bytes_read == uscpi->response_length)
|
||||||
|
scpi_usbtmc_read_begin(uscpi);
|
||||||
|
|
||||||
return (uscpi->response_bytes_read >= uscpi->response_length);
|
return (uscpi->response_bytes_read >= uscpi->response_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue