From e68bedaf93a142abc3810db2eefbbe88ad95d7e7 Mon Sep 17 00:00:00 2001 From: nHackel Date: Wed, 29 May 2024 16:58:43 +0200 Subject: [PATCH] Loop over scpi commands in data pipeline --- src/server/communication.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/server/communication.c b/src/server/communication.c index 73be1baf..44c0df22 100644 --- a/src/server/communication.c +++ b/src/server/communication.c @@ -332,11 +332,13 @@ void sendPipelinedDataToClient(uint64_t wpTotal, uint64_t numSamples, uint64_t c sendSamplesTotal += chunk; // Check if SCPI commands are waiting - rc = recv(clifd, smbuffer, sizeof (smbuffer), MSG_DONTWAIT); - if (rc > 0) { - SCPI_Input(&scpi_context, smbuffer, rc); - printf("Handled SCPI in loop\n"); - } + do { + rc = recv(clifd, smbuffer, sizeof (smbuffer), MSG_DONTWAIT); + if (rc > 0) { + SCPI_Input(&scpi_context, smbuffer, rc); + printf("Handled SCPI in loop\n"); + } + } while (rc > 0); } setServerMode(ACQUISITION); // Maybe get and reset previous mode later. Atm it has to be ACQUISITION anyways