return SR_OK;
}
+ /* No log message here, too verbose and not very useful. */
+
if (driver->dev_clear)
ret = driver->dev_clear(driver);
else
probe_name_path(addr, path);
status = g_file_get_contents(path->str, &buf, &size, &err);
if (!status) {
- sr_dbg("Name for probe %d can't be read: %s",
- prb_num, err->message);
+ /* Don't log "No such file or directory" messages. */
+ if (err->code != G_FILE_ERROR_NOENT)
+ sr_dbg("Name for probe %d can't be read (%d): %s",
+ prb_num, err->code, err->message);
g_string_free(path, TRUE);
g_error_free(err);
return ret;
return SR_ERR;
}
devc->detached_kernel_driver = 1;
- sr_dbg("Successfully detached kernel driver.");
- } else {
- sr_dbg("No need to detach a kernel driver.");
}
/* Claim interface 0. */
libusb_error_name(ret));
return SR_ERR;
}
- sr_dbg("Successfully claimed interface 0.");
return SR_OK;
}
ret, ftdi_get_error_string(devc->ftdic));
goto err_ftdi_free;
}
- sr_dbg("Device opened successfully.");
/* Purge RX/TX buffers in the FTDI chip. */
if ((ret = ftdi_usb_purge_buffers(devc->ftdic)) < 0) {
ret, ftdi_get_error_string(devc->ftdic));
goto err_ftdi_free;
}
- sr_dbg("FTDI buffers purged successfully.");
/* Enable flow control in the FTDI chip. */
if ((ret = ftdi_setflowctrl(devc->ftdic, SIO_RTS_CTS_HS)) < 0) {
ret, ftdi_get_error_string(devc->ftdic));
goto err_ftdi_free;
}
- sr_dbg("FTDI flow control enabled successfully.");
/* Wait 100ms. */
g_usleep(100 * 1000);
return SR_ERR;
}
- sr_dbg("Hardware acquisition started successfully.");
-
std_session_send_df_header(sdi);
/* Time when we should be done (for detecting trigger timeouts). */
bitpos = devc->enabled_logic_channels % 8;
mask = (1 << bitpos) - 1;
devc->first_partial_logic_mask = mask;
- sr_dbg("DBG: %s(), num logic %zu, partial off %zu, mask 0x%02x",
- __func__, devc->enabled_logic_channels,
+ sr_dbg("num logic %zu, partial off %zu, mask 0x%02x.",
+ devc->enabled_logic_channels,
devc->first_partial_logic_index,
devc->first_partial_logic_mask);
ag->packet.data = ag->pattern_data + ag_pattern_pos;
ag->packet.num_samples = sending_now;
sr_session_send(sdi, &packet);
- sr_dbg("DBG: %s() sending now: %lu", __func__, (unsigned long)sending_now);
/* Whichever channel group gets there first. */
*analog_sent = MAX(*analog_sent, sending_now);
/* How many samples are outstanding since the last round? */
samples_todo = (todo_us * devc->cur_samplerate + G_USEC_PER_SEC - 1)
/ G_USEC_PER_SEC;
- sr_dbg("DBG: %s() samples_todo before adjustment: %lu", __func__, (unsigned long)samples_todo);
if (devc->limit_samples > 0) {
if (devc->limit_samples < devc->sent_samples)
samples_todo = 0;
else if (devc->limit_samples - devc->sent_samples < samples_todo)
samples_todo = devc->limit_samples - devc->sent_samples;
}
- sr_dbg("DBG: %s() samples_todo after adjustment: %lu", __func__, (unsigned long)samples_todo);
/* Calculate the actual time covered by this run back from the sample
* count, rounded towards zero. This avoids getting stuck on a too-low
* time delta with no samples being sent due to round-off.
send_analog_packet(value, sdi, &analog_sent,
devc->sent_samples + analog_done,
samples_todo - analog_done);
- sr_dbg("DBG: %s() analog_sent: %lu", __func__, (unsigned long)analog_sent);
}
analog_done += analog_sent;
- sr_dbg("DBG: %s() analog_done: %lu", __func__, (unsigned long)analog_done);
}
}
/* At this point, both logic_done and analog_done should be
return NULL;
}
- sr_dbg("Number of FTDI devices found: %d", ret);
-
curdev = devlist;
while (curdev) {
scan_device(ftdic, curdev->dev, &devices);
ret, ftdi_get_error_string(devc->ftdic));
goto err_dev_open_close_ftdic;
}
- sr_dbg("FTDI chip buffers purged successfully.");
/* Reset the FTDI bitmode. */
ret = ftdi_set_bitmode(devc->ftdic, 0x00, BITMODE_RESET);
ret, ftdi_get_error_string(devc->ftdic));
goto err_dev_open_close_ftdic;
}
- sr_dbg("FTDI chip bitmode reset successfully.");
ret = ftdi_set_bitmode(devc->ftdic, 0x00, BITMODE_BITBANG);
if (ret < 0) {
ret, ftdi_get_error_string(devc->ftdic));
goto err_dev_open_close_ftdic;
}
- sr_dbg("FTDI chip bitbang mode entered successfully.");
return SR_OK;
conn = serialcomm = NULL;
serialcomm_given = FALSE;
- sr_spew("scan_1x_2x_rs232() called!");
-
for (l = options; l; l = l->next) {
src = l->data;
switch (src->key) {
conn = serialcomm = NULL;
devices = NULL;
- sr_spew("scan_2x_bd232() called!");
-
for (l = options; l; l = l->next) {
src = l->data;
switch (src->key) {
return std_scan_complete(di, devices);
exit_err:
- sr_info("scan_2x_bd232(): Error!");
-
sr_serial_dev_inst_free(serial);
g_free(devc);
sr_dev_inst_free(sdi);
usb_source_add(sdi->session, drvc->sr_ctx, 100,
ikalogic_scanalogic2_receive_data, (void *)sdi);
- sr_dbg("Acquisition started successfully.");
-
std_session_send_df_header(sdi);
devc->next_state = STATE_SAMPLE;
ftdi_get_error_string(devc->ftdic));
return SR_ERR;
}
- sr_dbg("FTDI chip interface A set successfully.");
/* Open the device. */
ret = ftdi_usb_open_desc(devc->ftdic, USB_VENDOR_ID, USB_DEVICE_ID,
ftdi_get_error_string(devc->ftdic));
return SR_ERR;
}
- sr_dbg("FTDI device opened successfully.");
/* Purge RX/TX buffers in the FTDI chip. */
if ((ret = ftdi_usb_purge_buffers(devc->ftdic)) < 0) {
ret, ftdi_get_error_string(devc->ftdic));
goto err_dev_open_close_ftdic;
}
- sr_dbg("FTDI chip buffers purged successfully.");
/* Reset the FTDI bitmode. */
ret = ftdi_set_bitmode(devc->ftdic, 0xff, BITMODE_RESET);
ret, ftdi_get_error_string(devc->ftdic));
goto err_dev_open_close_ftdic;
}
- sr_dbg("FTDI chip bitmode reset successfully.");
/* Set FTDI bitmode to "sync FIFO". */
ret = ftdi_set_bitmode(devc->ftdic, 0xff, BITMODE_SYNCFF);
ret, ftdi_get_error_string(devc->ftdic));
goto err_dev_open_close_ftdic;
}
- sr_dbg("FTDI chip sync FIFO mode entered successfully.");
/* Set the FTDI latency timer to 2. */
ret = ftdi_set_latency_timer(devc->ftdic, 2);
ret, ftdi_get_error_string(devc->ftdic));
goto err_dev_open_close_ftdic;
}
- sr_dbg("FTDI chip latency timer set successfully.");
/* Set the FTDI read data chunk size to 64kB. */
ret = ftdi_read_data_set_chunksize(devc->ftdic, 64 * 1024);
ret, ftdi_get_error_string(devc->ftdic));
goto err_dev_open_close_ftdic;
}
- sr_dbg("FTDI chip read data chunk size set successfully.");
/* Get the ScanaPLUS device ID from the FTDI EEPROM. */
if ((ret = scanaplus_get_device_id(devc)) < 0) {
devc = NULL;
conn = serialcomm = NULL;
- sr_spew("scan() called!");
-
/* Process and check options. */
if (sr_serial_extract_options(options, &conn, &serialcomm) != SR_OK)
return NULL;
ftdi_get_error_string(devc->ftdic));
return SR_ERR;
}
- sr_dbg("FTDI chip interface B set successfully.");
/* Check for the device and temporarily open it. */
ret = ftdi_usb_open_desc(devc->ftdic, USB_VENDOR_ID, USB_DEVICE_ID,
ftdi_get_error_string(devc->ftdic));
return SR_ERR;
}
- sr_dbg("FTDI device opened successfully.");
/* Purge RX/TX buffers in the FTDI chip. */
if ((ret = ftdi_usb_purge_buffers(devc->ftdic)) < 0) {
ret, ftdi_get_error_string(devc->ftdic));
goto err_open_close_ftdic;
}
- sr_dbg("FTDI chip buffers purged successfully.");
/* Reset the FTDI bitmode. */
ret = ftdi_set_bitmode(devc->ftdic, 0xff, BITMODE_RESET);
ret, ftdi_get_error_string(devc->ftdic));
goto err_open_close_ftdic;
}
- sr_dbg("FTDI chip bitmode reset successfully.");
/* Set the FTDI latency timer to 16. */
ret = ftdi_set_latency_timer(devc->ftdic, 16);
ret, ftdi_get_error_string(devc->ftdic));
goto err_open_close_ftdic;
}
- sr_dbg("FTDI chip latency timer set successfully.");
/* Set the FTDI read data chunk size to 64kB. */
ret = ftdi_read_data_set_chunksize(devc->ftdic, 64 * 1024);
ret, ftdi_get_error_string(devc->ftdic));
goto err_open_close_ftdic;
}
- sr_dbg("FTDI chip read data chunk size set successfully.");
return SR_OK;
libusb_error_name(ret));
return SR_ERR;
}
- sr_dbg("Successfully detached kernel driver.");
- } else {
- sr_dbg("No need to detach a kernel driver.");
}
/* Claim interface 0. */
libusb_error_name(ret));
return SR_ERR;
}
- sr_dbg("Successfully claimed interface 0.");
/* Set data for the HID feature report (e.g. baudrate). */
buf[0] = baudrate & 0xff; /* Baudrate, LSB */
return SR_ERR;
}
- sr_dbg("Successfully sent initial HID feature report.");
-
return SR_OK;
}
return SR_ERR_ARG;
}
+ /* No log message here, too verbose and not very useful. */
+
if ((ret = driver->init(driver, ctx)) < 0)
sr_err("Failed to initialize the driver: %d.", ret);
l = driver->scan(driver, options);
- sr_spew("Scan of '%s' found %d devices.", driver->name,
- g_slist_length(l));
+ sr_spew("Scan found %d devices (%s).", g_slist_length(l), driver->name);
return l;
}
if (!ctx)
return;
+ sr_dbg("Cleaning up all drivers.");
+
drivers = sr_driver_list(ctx);
for (i = 0; drivers[i]; i++) {
if (drivers[i]->cleanup)
*/
SR_PRIV void sr_config_free(struct sr_config *src)
{
-
if (!src || !src->data) {
sr_err("%s: invalid data!", __func__);
return;
g_variant_unref(src->data);
g_free(src);
-
}
/** @private */
}
libusb_free_device_list(devlist, 1);
- sr_dbg("Found %d device(s).", g_slist_length(resources));
+ /* No log message for #devices found (caller will log that). */
return resources;
}
if ((mstr = g_match_info_fetch(match, 2)))
pid = strtoul(mstr, NULL, 16);
g_free(mstr);
- sr_dbg("Trying to find USB device with VID:PID = %04x:%04x.",
- vid, pid);
+ /* Trying to find USB device via VID:PID. */
} else {
g_match_info_unref(match);
g_regex_unref(reg);
if ((mstr = g_match_info_fetch(match, 2)))
addr = strtoul(mstr, NULL, 10);
g_free(mstr);
- sr_dbg("Trying to find USB device with bus.address = "
- "%d.%d.", bus, addr);
+ /* Trying to find USB device via bus.address. */
}
}
g_match_info_unref(match);
}
libusb_free_device_list(devlist, 1);
- sr_dbg("Found %d device(s).", g_slist_length(devices));
+ /* No log message for #devices found (caller will log that). */
return devices;
}