The number of bytes read is already logged by the serial backend:
sr: [00:00.072857] scpi_serial: Read 1 bytes into buffer.
sr: [00:00.073884] serial: Read 1/2008 bytes.
sr: [00:00.073900] scpi_serial: Read 1 bytes into buffer.
sr: [00:00.074896] serial: Read 1/2007 bytes.
sr: [00:00.074905] scpi_serial: Read 1 bytes into buffer.
sr: [00:00.075949] serial: Read 1/2006 bytes.
return ret;
if (ret > 0) {
- sr_spew("Read %d bytes into buffer.", ret);
-
if (buf[ret - 1] == '\n') {
sscpi->got_newline = TRUE;
sr_spew("Received terminator");