if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
- if (!(devc = sdi->priv)) {
- sr_err("sdi->priv was NULL.");
- return SR_ERR_BUG;
- }
-
+ devc = sdi->priv;
devc->cb_data = cb_data;
std_session_send_df_header(cb_data, LOG_PREFIX);
return SR_OK;
}
-static int dev_acquisition_start(const struct sr_dev_inst *sdi,
- void *cb_data)
+static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
{
struct sr_serial_dev_inst *serial;
struct dev_context *devc;
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
- if (!(devc = sdi->priv)) {
- sr_err("sdi->priv was NULL.");
- return SR_ERR_BUG;
- }
-
+ devc = sdi->priv;
devc->session_cb_data = cb_data;
/*
return SR_ERR_DEV_CLOSED;
devc = sdi->priv;
-
serial = sdi->conn;
/* Send the 'monitor <ms>' command (doesn't have a reply). */
return std_serial_dev_close(sdi);
}
-static int dev_acquisition_start(const struct sr_dev_inst *sdi,
- void *cb_data)
+static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
{
struct dev_context *devc;
struct sr_serial_dev_inst *serial;
#define BUFUNIT_TIMEOUT_MS(devc) (100 + ((devc->bufunitsize * 1000) / \
(uint32_t)(devc->cur_samplerate)))
-static int dev_acquisition_start(const struct sr_dev_inst *sdi,
- void *cb_data)
+static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
{
- (void)cb_data;
struct dev_context *devc = sdi->priv;
struct sr_trigger *trigger;
+ (void)cb_data;
+
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
return SR_OK;
}
-static int dev_acquisition_start(const struct sr_dev_inst *sdi,
- void *cb_data)
+static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
{
struct dev_context *devc;
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
- if (!(devc = sdi->priv)) {
- sr_err("sdi->priv was NULL.");
- return SR_ERR_BUG;
- }
-
+ devc = sdi->priv;
devc->cb_data = cb_data;
/*
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
- if (!(devc = sdi->priv)) {
- sr_err("sdi->priv was NULL.");
- return SR_ERR_BUG;
- }
-
+ devc = sdi->priv;
devc->cb_data = cb_data;
devc->state = ST_INIT;
devc->num_samples = 0;
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
- if (!(devc = sdi->priv)) {
- sr_err("sdi->priv was NULL.");
- return SR_ERR_BUG;
- }
+ devc = sdi->priv;
if (!devc->ftdic) {
sr_err("devc->ftdic was NULL.");
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
- if (!(devc = sdi->priv)) {
- sr_err("sdi->priv was NULL.");
- return SR_ERR_BUG;
- }
-
+ devc = sdi->priv;
devc->cb_data = cb_data;
std_session_send_df_header(cb_data, LOG_PREFIX);
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
- if (!(devc = sdi->priv)) {
- sr_err("sdi->priv was NULL.");
- return SR_ERR_BUG;
- }
-
+ devc = sdi->priv;
devc->cb_data = cb_data;
std_session_send_df_header(cb_data, LOG_PREFIX);
struct dev_context *devc;
struct sr_serial_dev_inst *serial;
- if (!sdi || !cb_data || !(devc = sdi->priv))
- return SR_ERR_BUG;
-
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
+ devc = sdi->priv;
devc->cb_data = cb_data;
devc->settings_ok = FALSE;
devc->buflen = 0;
struct dev_context *devc;
struct sr_serial_dev_inst *serial;
- if (!sdi || !cb_data || !(devc = sdi->priv))
- return SR_ERR_BUG;
-
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
+ devc = sdi->priv;
devc->cb_data = cb_data;
devc->settings_ok = FALSE;
devc->buflen = 0;
return SR_OK;
}
-static int dev_acquisition_start(const struct sr_dev_inst *sdi,
- void *cb_data)
+static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
{
struct dev_context *devc = sdi->priv;
int ret;
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
- if (!(devc = sdi->priv))
- return SR_ERR_BUG;
+ devc = sdi->priv;
if (!devc->ftdic)
return SR_ERR_BUG;
return SR_OK;
}
-static int dev_acquisition_start(const struct sr_dev_inst *sdi,
- void *cb_data)
+static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
{
struct sr_dev_driver *di = sdi->driver;
struct drv_context *drvc;
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
- if (!(devc = sdi->priv))
- return SR_ERR_BUG;
-
+ devc = sdi->priv;
devc->cb_data = cb_data;
-
serial = sdi->conn;
sr_spew("Set O1 mode (continuous values, stable and unstable ones).");
return ret;
}
-static int dev_acquisition_start(const struct sr_dev_inst *sdi,
- void *cb_data)
+static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
{
struct dev_context *devc;
struct sr_modbus_dev_inst *modbus;
struct dev_context *devc;
struct sr_serial_dev_inst *serial;
- if (!sdi || !cb_data || !(devc = sdi->priv))
- return SR_ERR_BUG;
-
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
+ devc = sdi->priv;
devc->cb_data = cb_data;
std_session_send_df_header(cb_data, LOG_PREFIX);
return SR_OK;
}
-static int dev_acquisition_start(const struct sr_dev_inst *sdi,
- void *cb_data)
+static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
{
struct dev_context *devc;
struct sr_serial_dev_inst *serial;
return SR_OK;
}
-static int dev_acquisition_start(const struct sr_dev_inst *sdi,
- void *cb_data)
+static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
{
struct dev_context *devc;
uint32_t samplecount, readcount, delaycount;
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
- if (!(devc = sdi->priv)) {
- sr_err("sdi->priv was NULL.");
- return SR_ERR_BUG;
- }
-
+ devc = sdi->priv;
devc->cb_data = cb_data;
/*
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
- if (!(devc = sdi->priv)) {
- sr_err("sdi->priv was NULL.");
- return SR_ERR_BUG;
- }
-
+ devc = sdi->priv;
devc->session_cb_data = cb_data;
/*
return SR_OK;
}
-static int dev_acquisition_start(const struct sr_dev_inst *sdi,
- void *cb_data)
+static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
{
struct dev_context *devc;
struct sr_serial_dev_inst *serial;
struct dev_context *devc;
devc = sdi->priv;
-
devc->cb_data = cb_data;
-
devc->starttime = g_get_monotonic_time();
std_session_send_df_header(sdi, LOG_PREFIX);
return SR_OK;
}
-static int dev_acquisition_start(const struct sr_dev_inst *sdi,
- void *cb_data)
+static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
{
struct sr_dev_driver *di = sdi->driver;
struct drv_context *drvc;
return SR_OK;
}
-static int dev_acquisition_start(const struct sr_dev_inst *sdi,
- void *cb_data)
+static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
{
struct dev_context *devc;
struct sr_usb_dev_inst *usb;
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
- if (!(devc = sdi->priv)) {
- sr_err("%s: sdi->priv was NULL", __func__);
- return SR_ERR_ARG;
- }
+ devc = sdi->priv;
if (analyzer_add_triggers(sdi) != SR_OK) {
sr_err("Failed to configure triggers.");