]> sigrok.org Git - libsigrok.git/blobdiff - src/scpi/scpi_vxi.c
spci: Terminate all commands with a linefeed for all transports
[libsigrok.git] / src / scpi / scpi_vxi.c
index 8a99ec7474b3e5cee740f9e6367e0faa4651d315..9f6b2c356ea1444ce4def493014fca4766e1ef0d 100644 (file)
@@ -118,18 +118,16 @@ static int scpi_vxi_send(void *priv, const char *command)
        struct scpi_vxi *vxi = priv;
        Device_WriteResp *write_resp;
        Device_WriteParms write_parms;
-       char *terminated_command;
        unsigned long len;
 
-       terminated_command = g_strdup_printf("%s\r\n", command);
-       len = strlen(terminated_command);
+       len = strlen(command);
 
        write_parms.lid           = vxi->link;
        write_parms.io_timeout    = VXI_DEFAULT_TIMEOUT_MS;
        write_parms.lock_timeout  = VXI_DEFAULT_TIMEOUT_MS;
        write_parms.flags         = DF_END;
        write_parms.data.data_len = MIN(len, vxi->max_send_size);
-       write_parms.data.data_val = terminated_command;
+       write_parms.data.data_val = command;
 
        if (!(write_resp = device_write_1(&write_parms, vxi->client))
            || write_resp->error) {
@@ -138,8 +136,6 @@ static int scpi_vxi_send(void *priv, const char *command)
                return SR_ERR;
        }
 
-       g_free(terminated_command);
-
        if (write_resp->size < len)
                sr_dbg("Only sent %lu/%lu bytes of SCPI command: '%s'.",
                       write_resp->size, len, command);