From: Martin Ling Date: Wed, 22 Jan 2014 04:49:57 +0000 (+0000) Subject: rigol-ds: Only protocol v3 adds trailing linefeeds to data blocks. X-Git-Tag: libsigrok-0.3.0~202 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=2b399703d10dedfbed1f6b13070e0c3f5fd9938b;p=libsigrok.git rigol-ds: Only protocol v3 adds trailing linefeeds to data blocks. --- diff --git a/hardware/rigol-ds/protocol.c b/hardware/rigol-ds/protocol.c index 9a05dea9..8c66d63e 100644 --- a/hardware/rigol-ds/protocol.c +++ b/hardware/rigol-ds/protocol.c @@ -575,9 +575,11 @@ SR_PRIV int rigol_ds_receive(int fd, int revents, void *cb_data) if (devc->num_block_read == devc->num_block_bytes) { sr_dbg("Block has been completed"); - if (devc->format == FORMAT_IEEE488_2) { + if (devc->model->series->protocol >= PROTOCOL_V3) { /* Discard the terminating linefeed */ sr_scpi_read_data(scpi, (char *)devc->buffer, 1); + } + if (devc->format == FORMAT_IEEE488_2) { /* Prepare for possible next block */ devc->num_block_bytes = 0; if (devc->data_source != DATA_SOURCE_LIVE)