* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <config.h>
#include "protocol_wrappers.h"
#define MAX_COMMAND_SIZE 64
}
g_free(resp);
+
return result;
}
int result;
g_snprintf(cmd, sizeof(cmd), ":WAVEFORM:TRACE %d", channel);
- result = sr_scpi_send(scpi, cmd);
+ result = sr_scpi_send(scpi, cmd);
result &= sr_scpi_get_float(scpi, ":WAVEFORM:RANGE?", response);
return result;
}
int result;
g_snprintf(cmd, sizeof(cmd), ":WAVEFORM:TRACE %d", channel);
- result = sr_scpi_send(scpi, cmd);
+ result = sr_scpi_send(scpi, cmd);
result &= sr_scpi_get_float(scpi, ":WAVEFORM:OFFSET?", response);
return result;
}
return sr_scpi_send(scpi, ":LOGIC:MODE OFF");
}
-
int dlm_response_headers_set(struct sr_scpi_dev_inst *scpi,
const gboolean value)
{
return sr_scpi_send(scpi, ":STOP");
}
-
int dlm_acq_length_get(struct sr_scpi_dev_inst *scpi,
- int *response)
+ uint32_t *response)
{
- return sr_scpi_get_int(scpi, ":WAVEFORM:LENGTH?", response);
+ int ret;
+ char *s;
+ long tmp;
+
+ if (sr_scpi_get_string(scpi, ":WAVEFORM:LENGTH?", &s) != SR_OK)
+ if (!s)
+ return SR_ERR;
+
+ if (sr_atol(s, &tmp) == SR_OK)
+ ret = SR_OK;
+ else
+ ret = SR_ERR;
+
+ g_free(s);
+ *response = tmp;
+
+ return ret;
}
int dlm_chunks_per_acq_get(struct sr_scpi_dev_inst *scpi, int *response)
{
int result, acq_len;
- /* Data retrieval queries such as :WAVEFORM:SEND? will only return
+ /*
+ * Data retrieval queries such as :WAVEFORM:SEND? will only return
* up to 12500 samples at a time. If the oscilloscope operates in a
* mode where more than 12500 samples fit on screen (i.e. in one
* acquisition), data needs to be retrieved multiple times.