for (i = 0; supported_agdmm[i].model; i++) {
if (strcmp(supported_agdmm[i].modelname, tokens[1]))
continue;
- if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "Agilent",
+ if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, "Agilent",
tokens[1], tokens[3])))
return NULL;
if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) {
sr_info("Found device on port %s.", conn);
- if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "APPA", "55II", NULL)))
+ if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, "APPA", "55II", NULL)))
goto scan_cleanup;
if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) {
devc->use_triggers = 0;
/* Register SIGMA device. */
- if (!(sdi = sr_dev_inst_new(0, SR_ST_INITIALIZING, USB_VENDOR_NAME,
+ if (!(sdi = sr_dev_inst_new(SR_ST_INITIALIZING, USB_VENDOR_NAME,
USB_MODEL_NAME, NULL))) {
sr_err("%s: sdi was NULL", __func__);
goto free;
return NULL;
}
- sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "Atten", model->name, NULL);
+ sdi = sr_dev_inst_new(SR_ST_INACTIVE, "Atten", model->name, NULL);
sdi->driver = di;
sdi->inst_type = SR_INST_SERIAL;
sdi->conn = serial;
if (!g_file_test(BEAGLELOGIC_DEV_NODE, G_FILE_TEST_EXISTS))
return NULL;
- sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, NULL, "BeagleLogic", "1.0");
+ sdi = sr_dev_inst_new(SR_ST_INACTIVE, NULL, "BeagleLogic", "1.0");
sdi->driver = di;
/* Unless explicitly specified, keep max channels to 8 only */
for (l = usb_devices; l; l = l->next) {
usb = l->data;
- if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE,
+ if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE,
"Brymen", "BM869", NULL))) {
sr_err("sr_dev_inst_new returned NULL.");
return NULL;
sr_info("Found device on port %s.", conn);
- if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "Brymen", "BM85x", NULL)))
+ if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, "Brymen", "BM85x", NULL)))
goto scan_cleanup;
if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) {
while (g_get_monotonic_time() - start < MAX_SCAN_TIME) {
if (serial_read_nonblocking(serial, &c, 1) == 1 && c == 0xa5) {
/* Found one. */
- if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "CEM",
+ if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, "CEM",
"DT-885x", NULL)))
return NULL;
sr_info("Found device on port %s.", conn);
- if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, center_devs[idx].vendor,
+ if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, center_devs[idx].vendor,
center_devs[idx].device, NULL)))
goto scan_cleanup;
devc->cur_samplerate = devc->prof->max_samplerate;
/* Register the device with libsigrok. */
- sdi = sr_dev_inst_new(0, SR_ST_INITIALIZING,
+ sdi = sr_dev_inst_new(SR_ST_INITIALIZING,
"ChronoVu", devc->prof->modelname, NULL);
if (!sdi) {
sr_err("Failed to create device instance.");
if (!serialcomm)
serialcomm = SERIALCOMM;
- if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "Colead",
+ if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, "Colead",
"SL-5868P", NULL)))
return NULL;
sr_spew("Conrad DIGI 35 CPU assumed at %s.", conn);
- if (!(sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, "Conrad", "DIGI 35 CPU", NULL)))
+ if (!(sdi = sr_dev_inst_new(SR_ST_ACTIVE, "Conrad", "DIGI 35 CPU", NULL)))
return NULL;
sdi->conn = serial;
}
devices = NULL;
- sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, "Demo device", NULL, NULL);
+ sdi = sr_dev_inst_new(SR_ST_ACTIVE, "Demo device", NULL, NULL);
if (!sdi) {
sr_err("Device instance creation failed.");
return NULL;
continue;
/* Skip leading spaces in version number. */
for (s = 0; tokens[1][s] == ' '; s++);
- if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "Fluke",
+ if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, "Fluke",
tokens[0] + 6, tokens[1] + s)))
return NULL;
if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) {
if (!prof)
continue;
- sdi = sr_dev_inst_new(0, SR_ST_INITIALIZING,
+ sdi = sr_dev_inst_new(SR_ST_INITIALIZING,
prof->vendor, prof->model, prof->model_version);
if (!sdi)
return NULL;
if (model != METRAHIT_NONE) {
sr_spew("%s %s detected!", VENDOR_GMC, gmc_model_str(model));
- if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, VENDOR_GMC,
+ if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, VENDOR_GMC,
gmc_model_str(model), NULL)))
return NULL;
if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) {
goto exit_err;
}
- if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, VENDOR_GMC, NULL, NULL)))
+ if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, VENDOR_GMC, NULL, NULL)))
goto exit_err;
sdi->priv = devc;
goto exit_err;
}
- if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, VENDOR_GMC, NULL, NULL)))
+ if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, VENDOR_GMC, NULL, NULL)))
goto exit_err;
}
};
if (check_manufacturer(hw_info->manufacturer) != SR_OK)
goto fail;
- if (!(sdi = sr_dev_inst_new(0, SR_ST_ACTIVE,
+ if (!(sdi = sr_dev_inst_new(SR_ST_ACTIVE,
hw_info->manufacturer, hw_info->model,
hw_info->firmware_version))) {
goto fail;
struct dev_context *devc;
int i;
- sdi = sr_dev_inst_new(0, SR_ST_INITIALIZING,
+ sdi = sr_dev_inst_new(SR_ST_INITIALIZING,
prof->vendor, prof->model, NULL);
if (!sdi)
return NULL;
}
/* Register the device with libsigrok. */
- sdi = sr_dev_inst_new(0, SR_ST_INITIALIZING,
+ sdi = sr_dev_inst_new(SR_ST_INITIALIZING,
USB_VENDOR_NAME, USB_MODEL_NAME, NULL);
if (!sdi) {
sr_err("Failed to create device instance.");
for (l = usb_devices; l; l = l->next) {
if (scan_kecheng(l->data, &model) != SR_OK)
continue;
- if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, VENDOR,
+ if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, VENDOR,
model, NULL)))
return NULL;
g_free(model);
return NULL;
}
- if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, LASCAR_VENDOR,
+ if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, LASCAR_VENDOR,
profile->modelname, firmware)))
return NULL;
sdi->driver = di;
return devices;
}
- struct sr_dev_inst *sdi = sr_dev_inst_new(0, SR_ST_INACTIVE,
+ struct sr_dev_inst *sdi = sr_dev_inst_new(SR_ST_INACTIVE,
manufacturer, product, hwrev);
if (!sdi) {
}
/* Init device instance, etc. */
- if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "Manson",
+ if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, "Manson",
models[model_id].name, NULL))) {
sr_err("Failed to create device instance.");
return NULL;
sr_info("Found device on port %s.", conn);
/* TODO: Fill in version from protocol response. */
- if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, mic_devs[idx].vendor,
+ if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, mic_devs[idx].vendor,
mic_devs[idx].device, NULL)))
goto scan_cleanup;
Therefore just print an error message, but do not exit with error. */
sr_err("Failed to query for hardware version: %d %s", errno, strerror(errno));
- sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, VENDOR_MOTECH, models[modelid].modelstr, verstr);
+ sdi = sr_dev_inst_new(SR_ST_INACTIVE, VENDOR_MOTECH, models[modelid].modelstr, verstr);
sdi->driver = drv;
sdi->inst_type = SR_INST_SERIAL;
sdi->conn = serial;
auxtype = xgittoint(buf[7]);
sr_spew("%s %s DMM %s detected!", get_brandstr(drv), get_typestr(auxtype, drv), buf + 9);
- if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE,
+ if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE,
get_brandstr(drv), get_typestr(auxtype, drv), buf + 9)))
return NULL;
if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) {
} else {
/* Not an OLS -- some other board that uses the sump protocol. */
sr_info("Device does not support metadata.");
- sdi = sr_dev_inst_new(0, SR_ST_INACTIVE,
+ sdi = sr_dev_inst_new(SR_ST_INACTIVE,
"Sump", "Logic Analyzer", "v1.0");
sdi->driver = di;
for (i = 0; i < 32; i++) {
GString *tmp_str, *devname, *version;
guchar tmp_c;
- sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, NULL, NULL, NULL);
+ sdi = sr_dev_inst_new(SR_ST_INACTIVE, NULL, NULL, NULL);
sdi->driver = di;
devc = ols_dev_new();
sdi->priv = devc;
guchar tmp_c;
int index, i;
- sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, NULL, NULL, NULL);
+ sdi = sr_dev_inst_new(SR_ST_INACTIVE, NULL, NULL, NULL);
sdi->driver = di;
sdi->priv = devc;
}
}
- if (!model || !(sdi = sr_dev_inst_new(0, SR_ST_ACTIVE,
+ if (!model || !(sdi = sr_dev_inst_new(SR_ST_ACTIVE,
model->series->vendor->name,
model->name,
hw_info->firmware_version))) {
if (des.idVendor != LOGIC16_VID || des.idProduct != LOGIC16_PID)
continue;
- sdi = sr_dev_inst_new(0, SR_ST_INITIALIZING,
+ sdi = sr_dev_inst_new(SR_ST_INITIALIZING,
"Saleae", "Logic16", NULL);
if (!sdi)
return NULL;
return NULL;
}
- sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, vendor, hw_info->model,
+ sdi = sr_dev_inst_new(SR_ST_ACTIVE, vendor, hw_info->model,
hw_info->firmware_version);
sdi->conn = scpi;
sdi->driver = di;
sr_info("Found device on port %s.", conn);
- if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, dmms[dmm].vendor,
+ if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, dmms[dmm].vendor,
dmms[dmm].device, NULL)))
goto scan_cleanup;
sr_info("Found device on port %s.", conn);
- if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "EDF", "Teleinfo", NULL)))
+ if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, "EDF", "Teleinfo", NULL)))
goto scan_cleanup;
if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) {
if (!serialcomm)
serialcomm = SERIALCOMM;
- if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "Tondaj",
+ if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, "Tondaj",
"SL-814", NULL))) {
sr_err("Failed to create device instance.");
return NULL;
devc->first_run = TRUE;
- if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE,
+ if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE,
udmms[dmm].vendor, udmms[dmm].device, NULL))) {
sr_err("sr_dev_inst_new returned NULL.");
return NULL;
/* We have a list of sr_usb_dev_inst matching the connection
* string. Wrap them in sr_dev_inst and we're done. */
for (l = usb_devices; l; l = l->next) {
- if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, VENDOR,
+ if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, VENDOR,
MODEL, NULL)))
return NULL;
sdi->driver = di;
if (dlm_model_get(hw_info->model, &model_name, &model_index) != SR_OK)
goto fail;
- if (!(sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, MANUFACTURER_NAME,
+ if (!(sdi = sr_dev_inst_new(SR_ST_ACTIVE, MANUFACTURER_NAME,
model_name, NULL)))
goto fail;
sr_info("Found ZEROPLUS %s.", prof->model_name);
/* Register the device with libsigrok. */
- if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE,
+ if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE,
VENDOR_NAME, prof->model_name, NULL))) {
sr_err("%s: sr_dev_inst_new failed", __func__);
return NULL;