return SR_ERR_DEV_CLOSED;
sr_sw_limits_acquisition_start(&devc->limits);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
/* Poll every 100ms, or whenever some data comes in. */
serial = sdi->conn;
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close,
- sdi->conn, LOG_PREFIX);
+ sdi->conn);
}
static struct sr_dev_driver agdmm_driver_info = {
sr_sw_limits_acquisition_start(&devc->limits);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
/* Poll every 50ms, or whenever some data comes in. */
serial_source_add(sdi->session, serial, G_IO_IN, 50,
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
return std_serial_dev_acquisition_stop(sdi,
- std_serial_dev_close, sdi->conn, LOG_PREFIX);
+ std_serial_dev_close, sdi->conn);
}
static struct sr_dev_driver appa_55ii_driver_info = {
reloadpro_receive_data, (void *)sdi);
sr_sw_limits_acquisition_start(&devc->limits);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
memset(devc->buf, 0, RELOADPRO_BUFSIZE);
devc->buflen = 0;
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
return std_serial_dev_acquisition_stop(sdi,
- std_serial_dev_close, sdi->conn, LOG_PREFIX);
+ std_serial_dev_close, sdi->conn);
}
static struct sr_dev_driver arachnid_labs_re_load_pro_driver_info = {
gettimeofday(&devc->start_tv, 0);
sigma_set_register(WRITE_MODE, 0x0d, devc);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
/* Add capture source. */
sr_session_source_add(sdi->session, -1, 0, 10, sigma_receive_data, (void *)sdi);
dl_lines_done += dl_lines_curr;
}
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
sdi->driver->dev_acquisition_stop(sdi);
serial = sdi->conn;
serial_source_add(sdi->session, serial, G_IO_IN, 50,
atten_pps3xxx_receive_data, (void *)sdi);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
/* Send a "channel" configuration packet now. */
memset(packet, 0, PACKET_SIZE);
send_config(sdi);
else {
serial_source_remove(sdi->session, serial);
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
}
}
}
sr_session_source_add_channel(sdi->session, devc->channel,
G_IO_IN | G_IO_ERR, 1000, bl_acme_receive_data, (void *)sdi);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
sr_sw_limits_acquisition_start(&devc->limits);
return SR_OK;
g_io_channel_unref(devc->channel);
devc->channel = NULL;
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
if (devc->samples_missed > 0)
sr_warn("%" PRIu64 " samples missed", devc->samples_missed);
devc->trigger_fired = FALSE;
} else
devc->trigger_fired = TRUE;
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
/* Trigger and add poll on file */
beaglelogic_start(devc);
/* Remove session source and send EOT packet */
sr_session_source_remove_pollfd(sdi->session, &devc->pollfd);
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
return SR_OK;
}
if (devc->bytes_read >= devc->limit_samples * logic.unitsize ||
packetsize == 0) {
/* Send EOA Packet, stop polling */
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
sr_session_source_remove_pollfd(sdi->session, &devc->pollfd);
}
sr_sw_limits_acquisition_start(&devc->sw_limits);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
sr_session_source_add(sdi->session, -1, 0, 10,
brymen_bm86x_receive_data, (void *)sdi);
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
sr_session_source_remove(sdi->session, -1);
devc = sdi->priv;
sr_sw_limits_acquisition_start(&devc->sw_limits);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
/* Poll every 50ms, or whenever some data comes in. */
serial = sdi->conn;
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close,
- sdi->conn, LOG_PREFIX);
+ sdi->conn);
}
static struct sr_dev_driver brymen_bm857_driver_info = {
devc->num_samples = 0;
devc->buf_len = 0;
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
/* Poll every 100ms, or whenever some data comes in. */
serial = sdi->conn;
return SR_ERR_DEV_CLOSED;
return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close,
- sdi->conn, LOG_PREFIX);
+ sdi->conn);
}
static struct sr_dev_driver cem_dt_885x_driver_info = {
sr_sw_limits_acquisition_start(&devc->sw_limits);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
/* Poll every 500ms, or whenever some data comes in. */
serial = sdi->conn;
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
return std_serial_dev_acquisition_stop(sdi,
- std_serial_dev_close, sdi->conn, LOG_PREFIX);
+ std_serial_dev_close, sdi->conn);
}
/* Driver-specific API function wrappers */
sr_dbg("Hardware acquisition started successfully.");
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
/* Time when we should be done (for detecting trigger timeouts). */
devc->done = (devc->divcount + 1) * devc->prof->trigger_constant +
{
sr_dbg("Stopping acquisition.");
sr_session_source_remove(sdi->session, -1);
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
return SR_OK;
}
return SR_ERR_DEV_CLOSED;
sr_sw_limits_acquisition_start(&devc->limits);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
/* Poll every 150ms, or whenever some data comes in. */
serial = sdi->conn;
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close,
- sdi->conn, LOG_PREFIX);
+ sdi->conn);
}
static struct sr_dev_driver colead_slm_driver_info = {
sr_session_source_add(sdi->session, -1, 0, 100,
prepare_data, (struct sr_dev_inst *)sdi);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
/* We use this timestamp to decide how many more samples to send. */
devc->start_us = g_get_monotonic_time();
{
sr_dbg("Stopping acquisition.");
sr_session_source_remove(sdi->session, -1);
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
return SR_OK;
}
devc = sdi->priv;
sr_sw_limits_acquisition_start(&devc->limits);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
/* Poll every 100ms, or whenever some data comes in. */
serial = sdi->conn;
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close,
- sdi->conn, LOG_PREFIX);
+ sdi->conn);
}
static struct sr_dev_driver flukedmm_driver_info = {
devc->samples_sent = 0;
devc->bytes_received = 0;
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
/* Hook up a dummy handler to receive data from the device. */
sr_session_source_add(sdi->session, -1, G_IO_IN, 0,
sr_dbg("Stopping acquisition.");
sr_session_source_remove(sdi->session, -1);
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
return SR_OK;
}
else
devc->send_data_proc = la_send_data_proc;
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
return SR_OK;
}
if (transfer->status == LIBUSB_TRANSFER_CANCELLED) {
sr_dbg("Trigger transfer canceled.");
/* Terminate session. */
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
usb_source_remove(sdi->session, devc->ctx);
devc->num_transfers = 0;
g_free(devc->transfers);
devc = sdi->priv;
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
usb_source_remove(sdi->session, devc->ctx);
devc->buflen = 0;
sr_sw_limits_acquisition_start(&devc->limits);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
/* Poll every 40ms, or whenever some data comes in. */
serial = sdi->conn;
devc->buflen = 0;
sr_sw_limits_acquisition_start(&devc->limits);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
/* Poll every 40ms, or whenever some data comes in. */
serial = sdi->conn;
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
return std_serial_dev_acquisition_stop(sdi, dev_close,
- sdi->conn, LOG_PREFIX);
+ sdi->conn);
}
static struct sr_dev_driver gmc_mh_1x_2x_rs232_driver_info = {
packet.type = SR_DF_FRAME_END;
sr_session_send(sdi, &packet);
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
devc->df_started = FALSE;
}
devc->state = WAIT_FOR_TRANSFER_OF_CHANNEL_INDICATOR_COMPLETE;
if (!devc->df_started) {
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
packet.type = SR_DF_FRAME_BEGIN;
sr_session_send(sdi, &packet);
sr_scpi_source_add(sdi->session, scpi, G_IO_IN, 50,
hmo_receive_data, (void *)sdi);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
devc->current_channel = devc->enabled_channels;
struct dev_context *devc;
struct sr_scpi_dev_inst *scpi;
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
*/
usb_source_remove(sdi->session, drvc->sr_ctx);
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
devc->dev_state = IDLE;
if (hantek_6xxx_init(sdi) != SR_OK)
return SR_ERR;
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
devc->samp_received = 0;
devc->dev_state = FLUSH;
*/
usb_source_remove(sdi->session, drvc->sr_ctx);
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
devc->dev_state = IDLE;
devc->dev_state = CAPTURE;
usb_source_add(sdi->session, drvc->sr_ctx, TICK, handle_event, (void *)sdi);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
return SR_OK;
}
if (ret != SR_OK)
return ret;
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
front_selected = rear_selected = FALSE;
devc->active_channels = NULL;
if (ret != SR_OK)
return ret;
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
sr_session_source_add(sdi->session, -1, 0, 8,
hung_chang_dso_2100_poll, (void *)sdi);
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
sr_session_source_remove(sdi->session, -1);
hung_chang_dso_2100_move_to(sdi, 1);
sr_dbg("Acquisition started successfully.");
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
devc->next_state = STATE_SAMPLE;
usb_source_remove(sdi->session, drvc->sr_ctx);
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
sdi->status = SR_ST_ACTIVE;
}
usb_source_remove(sdi->session, drvc->sr_ctx);
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
sdi->driver->dev_close(sdi);
}
if ((ret = scanaplus_start_acquisition(devc)) < 0)
return ret;
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
/* Hook up a dummy handler to receive data from the device. */
sr_session_source_add(sdi->session, -1, 0, 0, scanaplus_receive_data, (void *)sdi);
{
sr_dbg("Stopping acquisition.");
sr_session_source_remove(sdi->session, -1);
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
return SR_OK;
}
devc->num_samples = 0;
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
if (devc->data_source == DATA_SOURCE_LIVE) {
/* Force configuration. */
devc->stored_samples = (buf[7] << 8) | buf[8];
if (devc->stored_samples == 0) {
/* Notify frontend of empty log by sending start/end packets. */
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
return SR_OK;
}
if (sdi->status == SR_ST_STOPPING) {
libusb_free_transfer(devc->xfer);
usb_source_remove(sdi->session, drvc->sr_ctx);
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
sdi->status = SR_ST_ACTIVE;
return TRUE;
}
/* Device replies with "A00\r\n" (OK) or "E01\r\n" (Error). Ignore. */
sr_sw_limits_acquisition_start(&devc->limits);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
/* Poll every 50ms, or whenever some data comes in. */
serial_source_add(sdi->session, serial, G_IO_IN, 50,
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close,
- sdi->conn, LOG_PREFIX);
+ sdi->conn);
}
#define SCALE(ID, CHIPSET, VENDOR, MODEL, CONN, BAUDRATE, PACKETSIZE, \
devc = sdi->priv;
sr_sw_limits_acquisition_start(&devc->limits);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
devc->reply_pending = FALSE;
devc->req_sent_at = 0;
return SR_ERR_DEV_CLOSED;
return std_serial_dev_acquisition_stop(sdi,
- std_serial_dev_close, sdi->conn, LOG_PREFIX);
+ std_serial_dev_close, sdi->conn);
}
static struct sr_dev_driver korad_kaxxxxp_driver_info = {
sr_dbg("Starting log retrieval.");
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
interval = (devc->config[0x1c] | (devc->config[0x1d] << 8)) * 1000;
packet.type = SR_DF_META;
if (devc->logged_samples == 0) {
/* This ensures the frontend knows the session is done. */
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
return SR_OK;
}
if (sdi->status == SR_ST_STOPPING) {
usb_source_remove(sdi->session, drvc->sr_ctx);
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
}
memset(&tv, 0, sizeof(struct timeval));
if ((ret = lls_start_acquisition(sdi)) < 0)
return ret;
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
return usb_source_add(sdi->session, drvc->sr_ctx, 100,
receive_usb_data, drvc);
devc = sdi->priv;
if (devc->abort_acquisition) {
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
usb_source_remove(sdi->session, drvc->sr_ctx);
return;
}
read_offset %= SAMPLE_BUF_SIZE;
}
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
}
static uint32_t transform_sample_count(struct dev_context *devc,
/* Reset trigger state. */
devc->trigger_state = 0x00;
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
/* Our first channel is analog, the other 8 are of type 'logic'. */
/* TODO. */
devc = sdi->priv;
serial_source_remove(sdi->session, devc->serial);
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
}
SR_PRIV int mso_clkrate_out(struct sr_serial_dev_inst *serial, uint16_t val)
devc = sdi->priv;
sr_sw_limits_acquisition_start(&devc->limits);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
devc->reply_pending = FALSE;
devc->req_sent_at = 0;
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
return std_serial_dev_acquisition_stop(sdi,
- std_serial_dev_close, sdi->conn, LOG_PREFIX);
+ std_serial_dev_close, sdi->conn);
}
static struct sr_dev_driver manson_hcs_3xxx_driver_info = {
return ret;
sr_sw_limits_acquisition_start(&devc->limits);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
return maynuo_m97_capture_start(sdi);
}
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
modbus = sdi->conn;
sr_modbus_source_remove(sdi->session, modbus);
devc = sdi->priv;
sr_sw_limits_acquisition_start(&devc->limits);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
/* Poll every 100ms, or whenever some data comes in. */
serial = sdi->conn;
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close,
- sdi->conn, LOG_PREFIX);
+ sdi->conn);
}
/* Driver-specific API function wrappers */
serial = sdi->conn;
serial_source_add(sdi->session, serial, G_IO_IN, 50,
motech_lps_30x_receive_data, (void *)sdi);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
sr_sw_limits_acquisition_start(&devc->limits);
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close,
- sdi->conn, LOG_PREFIX);
+ sdi->conn);
}
static struct sr_dev_driver motech_lps_301_driver_info = {
devc = sdi->priv;
sr_sw_limits_acquisition_start(&devc->limits);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
/* Poll every 100ms, or whenever some data comes in. */
serial = sdi->conn;
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close,
- sdi->conn, LOG_PREFIX);
+ sdi->conn);
}
static struct sr_dev_driver norma_dmm_driver_info = {
devc->cnt_bytes = devc->cnt_samples = devc->cnt_samples_rle = 0;
memset(devc->sample, 0, 4);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
/* If the device stops sending for longer than it takes to send a byte,
* that means it's finished. But wait at least 100 ms to be safe.
serial = sdi->conn;
serial_source_remove(sdi->session, serial);
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
}
SR_PRIV int ols_receive_data(int fd, int revents, void *cb_data)
devc = sdi->priv;
devc->buffer_len = 0;
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
/* Poll every 150ms, or whenever some data comes in. */
serial = sdi->conn;
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
return std_serial_dev_acquisition_stop(sdi, dev_close,
- sdi->conn, LOG_PREFIX);
+ sdi->conn);
}
static struct sr_dev_driver pce_322a_driver_info = {
devc->cnt_bytes = devc->cnt_samples = devc->cnt_samples_rle = 0;
memset(devc->sample, 0, 4);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
/* Hook up a dummy handler to receive data from the device. */
sr_session_source_add(sdi->session, -1, 0, 10, p_ols_receive_data,
sr_session_source_remove(sdi->session, -1);
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
return SR_OK;
}
sr_scpi_source_add(sdi->session, scpi, G_IO_IN, 50,
rigol_ds_receive, (void *)sdi);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
devc->channel_entry = devc->enabled_channels;
return SR_ERR;
}
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
g_slist_free(devc->enabled_channels);
devc->enabled_channels = NULL;
usb_source_add(sdi->session, devc->ctx, timeout, receive_data, (void *)sdi);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
if ((ret = logic16_start_acquisition(sdi)) != SR_OK) {
abort_acquisition(devc);
devc = sdi->priv;
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
usb_source_remove(sdi->session, devc->ctx);
if ((ret = sr_scpi_source_add(sdi->session, scpi, G_IO_IN, 10,
scpi_pps_receive_data, (void *)sdi)) != SR_OK)
return ret;
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
/* Prime the pipe with the first channel's fetch. */
ch = sr_next_enabled_channel(sdi, NULL);
sr_scpi_get_float(scpi, NULL, &f);
sr_scpi_source_remove(sdi->session, scpi);
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
return SR_OK;
}
devc = sdi->priv;
sr_sw_limits_acquisition_start(&devc->limits);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
/* Poll every 50ms, or whenever some data comes in. */
serial = sdi->conn;
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close,
- sdi->conn, LOG_PREFIX);
+ sdi->conn);
}
#define DMM(ID, CHIPSET, VENDOR, MODEL, CONN, BAUDRATE, PACKETSIZE, TIMEOUT, \
/* We are done, clean up and send end packet to session bus. */
clear_acquisition_state(sdi);
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
return G_SOURCE_REMOVE;
}
ret = submit_request(sdi, STATE_START_CAPTURE);
if (ret == SR_OK)
- ret = std_session_send_df_header(sdi, LOG_PREFIX);
+ ret = std_session_send_df_header(sdi);
if (ret != SR_OK) {
usb_source_remove(sdi->session, drvc->sr_ctx);
sr_sw_limits_acquisition_start(&devc->sw_limits);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
/* Poll every 50ms, or whenever some data comes in. */
serial_source_add(sdi->session, serial, G_IO_IN, 50,
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
return std_serial_dev_acquisition_stop(sdi,
- std_serial_dev_close, sdi->conn, LOG_PREFIX);
+ std_serial_dev_close, sdi->conn);
}
static struct sr_dev_driver teleinfo_driver_info = {
if (sdi->status == SR_ST_STOPPING) {
usb_source_remove(sdi->session, drvc->sr_ctx);
dev_close(sdi);
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
}
memset(&tv, 0, sizeof(struct timeval));
usb = sdi->conn;
devc->reply_size = 0;
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
usb_source_add(sdi->session, drvc->sr_ctx, 100,
handle_events, (void *)sdi);
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
sr_sw_limits_acquisition_start(&devc->limits);
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
return std_serial_dev_acquisition_stop(sdi, std_serial_dev_close,
- sdi->conn, LOG_PREFIX);
+ sdi->conn);
}
static struct sr_dev_driver tondaj_sl_814_driver_info = {
sr_sw_limits_acquisition_start(&devc->limits);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
sr_session_source_add(sdi->session, -1, 0, 10 /* poll_timeout */,
uni_t_dmm_receive_data, (void *)sdi);
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
sr_dbg("Stopping acquisition.");
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
sr_session_source_remove(sdi->session, -1);
return SR_OK;
return SR_ERR;
}
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
if (!(devc->xfer = libusb_alloc_transfer(0)))
return SR_ERR;
if (sdi->status == SR_ST_STOPPING) {
usb_source_remove(sdi->session, drvc->sr_ctx);
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
/* Tell the device to stop sending USB packets. */
usb = sdi->conn;
if (sdi->status == SR_ST_STOPPING) {
usb_source_remove(sdi->session, drvc->sr_ctx);
dev_close(sdi);
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
}
memset(&tv, 0, sizeof(struct timeval));
usb = sdi->conn;
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
usb_source_add(sdi->session, drvc->sr_ctx, 100,
handle_events, (void *)sdi);
{
struct dev_context *devc;
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
sr_info("Ramsize trigger = 0x%x.", ramsize_trigger);
sr_info("Memory size = 0x%x.", memory_size);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
/* Check for empty capture */
if ((status & STATUS_READY) && !stop_address) {
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
return SR_OK;
}
analyzer_read_stop(usb->devhdl);
g_free(buf);
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
return SR_OK;
}
{
struct sr_usb_dev_inst *usb;
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
usb = sdi->conn;
analyzer_reset(usb->devhdl);
inc = in->priv;
if (!inc->started) {
- std_session_send_df_header(in->sdi, LOG_PREFIX);
+ std_session_send_df_header(in->sdi);
if (inc->samplerate) {
packet.type = SR_DF_META;
inc = in->priv;
if (inc->started)
- std_session_send_df_end(in->sdi, LOG_PREFIX);
+ std_session_send_df_end(in->sdi);
return ret;
}
inc = in->priv;
if (!inc->started) {
- std_session_send_df_header(in->sdi, LOG_PREFIX);
+ std_session_send_df_header(in->sdi);
if (inc->samplerate) {
packet.type = SR_DF_META;
inc = in->priv;
if (inc->started)
- std_session_send_df_end(in->sdi, LOG_PREFIX);
+ std_session_send_df_end(in->sdi);
return ret;
}
inc = in->priv;
if (!inc->started) {
- std_session_send_df_header(in->sdi, LOG_PREFIX);
+ std_session_send_df_header(in->sdi);
if (inc->samplerate) {
packet.type = SR_DF_META;
inc = in->priv;
if (inc->started)
- std_session_send_df_end(in->sdi, LOG_PREFIX);
+ std_session_send_df_end(in->sdi);
return ret;
}
inc = in->priv;
if (!inc->started) {
- std_session_send_df_header(in->sdi, LOG_PREFIX);
+ std_session_send_df_header(in->sdi);
if (inc->samplerate) {
packet.type = SR_DF_META;
inc = in->priv;
if (inc->started)
- std_session_send_df_end(in->sdi, LOG_PREFIX);
+ std_session_send_df_end(in->sdi);
return ret;
}
}
if (!inc->meta_sent) {
- std_session_send_df_header(in->sdi, LOG_PREFIX);
+ std_session_send_df_header(in->sdi);
send_metadata(in);
}
flush_output_buffer(in);
if (inc->meta_sent)
- std_session_send_df_end(in->sdi, LOG_PREFIX);
+ std_session_send_df_end(in->sdi);
return ret;
}
inc = in->priv;
if (!inc->started) {
- std_session_send_df_header(in->sdi, LOG_PREFIX);
+ std_session_send_df_header(in->sdi);
packet.type = SR_DF_META;
packet.payload = &meta;
send_buffer(in);
if (inc->started)
- std_session_send_df_end(in->sdi, LOG_PREFIX);
+ std_session_send_df_end(in->sdi);
return ret;
}
inc = in->priv;
if (!inc->started) {
- std_session_send_df_header(in->sdi, LOG_PREFIX);
+ std_session_send_df_header(in->sdi);
packet.type = SR_DF_META;
packet.payload = &meta;
inc = in->priv;
if (inc->started)
- std_session_send_df_end(in->sdi, LOG_PREFIX);
+ std_session_send_df_end(in->sdi);
return ret;
}
dev_limit_counter_start(&devc->frame_count);
dev_time_counter_start(&devc->time_count);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
/* Poll every 50ms, or whenever some data comes in. */
serial = sdi->conn;
SR_PRIV int es51919_serial_acquisition_stop(struct sr_dev_inst *sdi)
{
return std_serial_dev_acquisition_stop(sdi,
- std_serial_dev_close, sdi->conn, LOG_PREFIX);
+ std_serial_dev_close, sdi->conn);
}
SR_PRIV int std_serial_dev_open(struct sr_dev_inst *sdi);
SR_PRIV int std_serial_dev_acquisition_stop(struct sr_dev_inst *sdi,
dev_close_callback dev_close_fn,
- struct sr_serial_dev_inst *serial, const char *prefix);
+ struct sr_serial_dev_inst *serial);
#endif
-SR_PRIV int std_session_send_df_header(const struct sr_dev_inst *sdi,
- const char *prefix);
-SR_PRIV int std_session_send_df_end(const struct sr_dev_inst *sdi,
- const char *prefix);
+SR_PRIV int std_session_send_df_header(const struct sr_dev_inst *sdi);
+SR_PRIV int std_session_send_df_end(const struct sr_dev_inst *sdi);
SR_PRIV int std_dev_clear(const struct sr_dev_driver *driver,
std_dev_clear_callback clear_private);
SR_PRIV GSList *std_dev_list(const struct sr_dev_driver *di);
vdev->archive = NULL;
}
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
return G_SOURCE_REMOVE;
}
return SR_ERR;
}
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
/* freewheeling source */
sr_session_source_add(sdi->session, -1, 0, 0, receive_data, (void *)sdi);
* dev_acquisition_start() API callback.
*
* @param sdi The device instance to use.
- * @param prefix A driver-specific prefix string used for log messages.
- * Must not be NULL. An empty string is allowed.
*
* @return SR_OK upon success, SR_ERR_ARG upon invalid arguments, or
* SR_ERR upon other errors.
*/
-SR_PRIV int std_session_send_df_header(const struct sr_dev_inst *sdi,
- const char *prefix)
+SR_PRIV int std_session_send_df_header(const struct sr_dev_inst *sdi)
{
+ const char *prefix = sdi->driver->name;
int ret;
struct sr_datafeed_packet packet;
struct sr_datafeed_header header;
- if (!prefix) {
- sr_err("Invalid prefix.");
- return SR_ERR_ARG;
- }
-
sr_dbg("%s: Starting acquisition.", prefix);
/* Send header packet to the session bus. */
* Standard API helper for sending an SR_DF_END packet.
*
* @param sdi The device instance to use. Must not be NULL.
- * @param prefix A driver-specific prefix string used for log messages.
- * Must not be NULL. An empty string is allowed.
*
* @return SR_OK upon success, SR_ERR_ARG upon invalid arguments, or
* SR_ERR upon other errors.
*/
-SR_PRIV int std_session_send_df_end(const struct sr_dev_inst *sdi,
- const char *prefix)
+SR_PRIV int std_session_send_df_end(const struct sr_dev_inst *sdi)
{
+ const char *prefix = sdi->driver->name;
int ret;
struct sr_datafeed_packet packet;
- if (!sdi || !prefix)
+ if (!sdi)
return SR_ERR_ARG;
sr_dbg("%s: Sending SR_DF_END packet.", prefix);
* Must not be NULL.
* @param serial The serial device instance (struct serial_dev_inst *).
* Must not be NULL.
- * @param[in] prefix A driver-specific prefix string used for log messages.
- * Must not be NULL. An empty string is allowed.
*
* @retval SR_OK Success.
* @retval SR_ERR_ARG Invalid arguments.
*/
SR_PRIV int std_serial_dev_acquisition_stop(struct sr_dev_inst *sdi,
dev_close_callback dev_close_fn,
- struct sr_serial_dev_inst *serial, const char *prefix)
+ struct sr_serial_dev_inst *serial)
{
+ const char *prefix = sdi->driver->name;
int ret;
- if (!prefix) {
- sr_err("Invalid prefix.");
- return SR_ERR_ARG;
- }
-
if (sdi->status != SR_ST_ACTIVE) {
sr_err("%s: Device inactive, can't stop acquisition.", prefix);
return SR_ERR_DEV_CLOSED;
return ret;
}
- std_session_send_df_end(sdi, prefix);
+ std_session_send_df_end(sdi);
return SR_OK;
}