rigol-ds: Handle partial analog frame reads.

Reading a frame over the DS1xx2 RS232 connection now sometimes works,
but most of the time stalls part way through with g_poll showing the
fd as not ready.
This commit is contained in:
Martin Ling 2013-12-04 13:08:49 +00:00
parent 9dfeb81b09
commit 56868b5d6b
1 changed files with 8 additions and 12 deletions

View File

@ -517,6 +517,7 @@ SR_PRIV int rigol_ds_receive(int fd, int revents, void *cb_data)
rigol_ds_set_wait_event(devc, WAIT_BLOCK); rigol_ds_set_wait_event(devc, WAIT_BLOCK);
} else } else
sr_dbg("%d of %d block bytes read", devc->num_block_read, devc->num_block_bytes); sr_dbg("%d of %d block bytes read", devc->num_block_read, devc->num_block_bytes);
}
devc->num_frame_bytes += len; devc->num_frame_bytes += len;
@ -525,11 +526,6 @@ SR_PRIV int rigol_ds_receive(int fd, int revents, void *cb_data)
return TRUE; return TRUE;
sr_dbg("Frame completed, %d samples", devc->num_frame_bytes); sr_dbg("Frame completed, %d samples", devc->num_frame_bytes);
} else {
if (len != DS1000_ANALOG_LIVE_WAVEFORM_SIZE)
/* Don't have the whole frame yet. */
return TRUE;
}
} else { } else {
logic.length = len - 10; logic.length = len - 10;
logic.unitsize = 2; logic.unitsize = 2;