]> sigrok.org Git - libsigrok.git/blobdiff - src/scpi/scpi_serial.c
spci: Terminate all commands with a linefeed for all transports
[libsigrok.git] / src / scpi / scpi_serial.c
index 096a77c1e74fefe823523dafd950496883f6c366..02242ef66b5dc86d36502e6b352e9e6b5b1079b1 100644 (file)
@@ -123,26 +123,21 @@ static int scpi_serial_source_remove(struct sr_session *session, void *priv)
 static int scpi_serial_send(void *priv, const char *command)
 {
        int len, result, written;
-       gchar *terminated_command;
        struct scpi_serial *sscpi = priv;
        struct sr_serial_dev_inst *serial = sscpi->serial;
 
-       terminated_command = g_strconcat(command, "\n", NULL);
-       len = strlen(terminated_command);
+       len = strlen(command);
        written = 0;
        while (written < len) {
                result = serial_write_nonblocking(serial,
-                               terminated_command + written, len - written);
+                               command + written, len - written);
                if (result < 0) {
                        sr_err("Error while sending SCPI command: '%s'.", command);
-                       g_free(terminated_command);
                        return SR_ERR;
                }
                written += result;
        }
 
-       g_free(terminated_command);
-
        sr_spew("Successfully sent SCPI command: '%s'.", command);
 
        return SR_OK;