Skip to content

Commit

Permalink
Loop over scpi commands in data pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
nHackel committed May 29, 2024
1 parent ce4d9eb commit e68beda
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/server/communication.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e68beda

Please sign in to comment.