]> sigrok.org Git - libsigrok.git/commit - src/scpi/scpi_tcp.c
scpi_tcp: use common TCP support in SCPI transport (tcp-raw, tcp-rigol)
authorGerhard Sittig <redacted>
Sun, 24 Sep 2023 08:42:00 +0000 (10:42 +0200)
committerGerhard Sittig <redacted>
Mon, 25 Sep 2023 17:30:18 +0000 (19:30 +0200)
commit4fd492230daa3be9be59cabe81ddcf8167a37654
tree5afdf97a20a3c6e0d367370c82c0696bbec46325
parentfcab496c12b2b94e85513c61513a24dbd9d6698a
scpi_tcp: use common TCP support in SCPI transport (tcp-raw, tcp-rigol)

Use the recently added sr_tcp_dev_inst approach to TCP communication in
the tcp-raw and tcp-rigol SCPI transports. Eliminates redundancy in the
implementation.

Address style nits in the process: Use size types for length specs. Be
explicit about bytes and character conversions: Bytes are sent across
the TCP socket, while SCPI exchange typically involves text messages.
The previously used send(2) and recv(2) calls just passed void pointers.

Comment on the specific semantics of Rigol length specs that preceed the
response data. And how raw TCP attempts to determine the completion of a
reception while this length spec is absent. The previous implementation
would not reveal the motivation of this non-trivial logic.
src/scpi/scpi_tcp.c