]> sigrok.org Git - libsigrok.git/commitdiff
Use driver name as the log prefix in standard functions
authorLars-Peter Clausen <redacted>
Sun, 8 May 2016 13:47:35 +0000 (15:47 +0200)
committerUwe Hermann <redacted>
Tue, 31 May 2016 13:54:52 +0000 (15:54 +0200)
Some of the standard helper functions take a log prefix parameter that is
used when printing messages. This log prefix is almost always identical to
the name field in the driver's sr_dev_driver struct. The only exception are
drivers which register multiple sr_dev_driver structs.

Instead of passing the log prefix as a parameter simply use the driver's
name. This simplifies the API, gives consistent behaviour between different
drivers and also makes it easier to identify where the message originates
when a driver registers sr_dev_driver structs.

Signed-off-by: Lars-Peter Clausen <redacted>
77 files changed:
src/hardware/agilent-dmm/api.c
src/hardware/appa-55ii/api.c
src/hardware/arachnid-labs-re-load-pro/api.c
src/hardware/asix-sigma/api.c
src/hardware/asix-sigma/protocol.c
src/hardware/atten-pps3xxx/api.c
src/hardware/atten-pps3xxx/protocol.c
src/hardware/baylibre-acme/api.c
src/hardware/beaglelogic/api.c
src/hardware/beaglelogic/protocol.c
src/hardware/brymen-bm86x/api.c
src/hardware/brymen-dmm/api.c
src/hardware/cem-dt-885x/api.c
src/hardware/center-3xx/api.c
src/hardware/chronovu-la/api.c
src/hardware/colead-slm/api.c
src/hardware/demo/demo.c
src/hardware/fluke-dmm/api.c
src/hardware/ftdi-la/api.c
src/hardware/fx2lafw/api.c
src/hardware/fx2lafw/protocol.c
src/hardware/gmc-mh-1x-2x/api.c
src/hardware/gwinstek-gds-800/api.c
src/hardware/gwinstek-gds-800/protocol.c
src/hardware/hameg-hmo/api.c
src/hardware/hantek-6xxx/api.c
src/hardware/hantek-dso/api.c
src/hardware/hp-3457a/api.c
src/hardware/hung-chang-dso-2100/api.c
src/hardware/ikalogic-scanalogic2/api.c
src/hardware/ikalogic-scanalogic2/protocol.c
src/hardware/ikalogic-scanaplus/api.c
src/hardware/kecheng-kc-330b/api.c
src/hardware/kecheng-kc-330b/protocol.c
src/hardware/kern-scale/api.c
src/hardware/korad-kaxxxxp/api.c
src/hardware/lascar-el-usb/api.c
src/hardware/lascar-el-usb/protocol.c
src/hardware/lecroy-logicstudio/api.c
src/hardware/lecroy-logicstudio/protocol.c
src/hardware/link-mso19/api.c
src/hardware/link-mso19/protocol.c
src/hardware/manson-hcs-3xxx/api.c
src/hardware/maynuo-m97/api.c
src/hardware/mic-985xx/api.c
src/hardware/motech-lps-30x/api.c
src/hardware/norma-dmm/api.c
src/hardware/openbench-logic-sniffer/api.c
src/hardware/openbench-logic-sniffer/protocol.c
src/hardware/pce-322a/api.c
src/hardware/pipistrello-ols/api.c
src/hardware/rigol-ds/api.c
src/hardware/saleae-logic16/api.c
src/hardware/saleae-logic16/protocol.c
src/hardware/scpi-pps/api.c
src/hardware/serial-dmm/api.c
src/hardware/sysclk-lwla/protocol.c
src/hardware/teleinfo/api.c
src/hardware/testo/api.c
src/hardware/tondaj-sl-814/api.c
src/hardware/uni-t-dmm/api.c
src/hardware/uni-t-ut32x/api.c
src/hardware/uni-t-ut32x/protocol.c
src/hardware/victor-dmm/api.c
src/hardware/yokogawa-dlm/api.c
src/hardware/zeroplus-logic-cube/api.c
src/input/binary.c
src/input/chronovu_la8.c
src/input/csv.c
src/input/raw_analog.c
src/input/trace32_ad.c
src/input/vcd.c
src/input/wav.c
src/lcr/es51919.c
src/libsigrok-internal.h
src/session_driver.c
src/std.c

index df9c095a97e7fe37e8ac18e23c00b4525f0fee4b..0cfb1ef07a337a85535e9cf08f316709edf82da2 100644 (file)
@@ -198,7 +198,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
                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;
@@ -211,7 +211,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
 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 = {
index 960b88167e6a6c8a66779dc7b054b19643c711f0..4f1233e4f5e6b8b3dbc5e5129bcbf1198c7f366f 100644 (file)
@@ -206,7 +206,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
 
        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,
@@ -218,7 +218,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
 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 = {
index 45bc7a159f27f39e48c6dccfcba14415388d4845..533be9269d8e92909291e29c2661cdd7aa2609b5 100644 (file)
@@ -327,7 +327,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
                          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;
@@ -338,7 +338,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
 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 = {
index a102b03b32d6ef672175eda65ede82cebef43c11..d420998889ed3b821db735ddfee86cdc554d87c4 100644 (file)
@@ -372,7 +372,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        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);
index d9db069eb4cd00b2f73cfcfa2d8b09964b5e0cb6..5fa7b2d015a1080d442e8b12ec162131e9f00eff 100644 (file)
@@ -906,7 +906,7 @@ static int download_capture(struct sr_dev_inst *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);
 
index b1724550e1d9012f3b03d53cd8f954a4623ba093..01c0d369a490adb6a8983d3f3f5f5a69913a050e 100644 (file)
@@ -451,7 +451,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *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);
index 06a1d2e90d93546af3602e41ac399c04a9816d63..72b4a03ec5d4d9dc82e7777af14baf77627db97f 100644 (file)
@@ -155,7 +155,7 @@ SR_PRIV int atten_pps3xxx_receive_data(int fd, int revents, void *cb_data)
                                send_config(sdi);
                        else {
                                serial_source_remove(sdi->session, serial);
-                               std_session_send_df_end(sdi, LOG_PREFIX);
+                               std_session_send_df_end(sdi);
                        }
                }
        }
index ed21b921eae0f264ecb02806ba78bba93c94c0ae..a1b860e3621fb91a1655d97fda085a66fb339e08 100644 (file)
@@ -348,7 +348,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *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;
@@ -369,7 +369,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi)
        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);
index f945c3aa1d142aa1f85464078f8eab8376218ef5..34b09f211fb26f2b54e464a7f973c2ce0a51ee3e 100644 (file)
@@ -317,7 +317,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
                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);
@@ -343,7 +343,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi)
 
        /* 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;
 }
index ce6c2ae9881067137eb06ea399d715f63a1d41e8..8f3ce26593175b50aff04570dc481a633684071b 100644 (file)
@@ -101,7 +101,7 @@ SR_PRIV int beaglelogic_receive_data(int fd, int revents, void *cb_data)
        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);
        }
 
index a9ac15b3b37ad9754a750459161468e003fb96c1..fb9f2807efd87496a18e346a8597d7a319c61cbe 100644 (file)
@@ -217,7 +217,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
 
        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);
@@ -230,7 +230,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *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);
 
index c9f63b16022ad24d5fe60411ff397588603ea3e4..8dc7a160326b8da6a1ed40d506c7e3075aa71312 100644 (file)
@@ -166,7 +166,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        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;
@@ -179,7 +179,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
 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 = {
index 03dc4f058d262ba4da0f9389810493511654e23a..37aa9bf069ff2605179bd272ede0ca9ef868b01d 100644 (file)
@@ -354,7 +354,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        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;
@@ -370,7 +370,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi)
                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 = {
index 468093c42a7f920386627a2f80dcddd90e816810..f5be8a8329997a89ed8643f3e92e43710576cc9a 100644 (file)
@@ -173,7 +173,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, int idx)
 
        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;
@@ -186,7 +186,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, int idx)
 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 */
index ea247d42be898213f75e114195490c04c06a00ee..f855f8e804fa90037b912d52f68fc8365aba4d41 100644 (file)
@@ -537,7 +537,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
 
        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 +
@@ -555,7 +555,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *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;
 }
index 85ccd86c2cea194a660691c157566d7766b7c165..3ed4c85a56c54b897ab93ec70b611b4a5261033e 100644 (file)
@@ -127,7 +127,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
                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;
@@ -140,7 +140,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
 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 = {
index bd9189d648f0c57dd71d2584bb18cd5659133e0a..288abef2b58be5885b17204c9f87297e9bc99f7f 100644 (file)
@@ -850,7 +850,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        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();
@@ -863,7 +863,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *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;
 }
index deca6c9e3a441fe7ed2d34dda1fdaba4d5b0072f..f9683e6a68cce25680eb595810a790c088e5e2f9 100644 (file)
@@ -227,7 +227,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        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;
@@ -247,7 +247,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
 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 = {
index 78dc23f779f74f4e3bcf9ee06a9557131db1e42b..22715a1f43dc20480bb0724e624d439550b5b523 100644 (file)
@@ -451,7 +451,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        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,
@@ -468,7 +468,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *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;
 }
index 46b9ee34e15dc318fb88e506cb3a0ef5a026ef0d..e1eb3ee13ce3e600b3bc212b4048324885b482e1 100644 (file)
@@ -857,7 +857,7 @@ static int start_transfers(const struct sr_dev_inst *sdi)
        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;
 }
@@ -873,7 +873,7 @@ static void LIBUSB_CALL dslogic_trigger_receive(struct libusb_transfer *transfer
        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);
index 3ec904c28aee66ab589a210f924b9a7e5636f7a3..8e69b77fd545eb38641d1fe34252cd6b182c16e0 100644 (file)
@@ -331,7 +331,7 @@ static void finish_acquisition(struct sr_dev_inst *sdi)
 
        devc = sdi->priv;
 
-       std_session_send_df_end(sdi, LOG_PREFIX);
+       std_session_send_df_end(sdi);
 
        usb_source_remove(sdi->session, devc->ctx);
 
index 0ca9029fe355b8eadbff8cb379641bbe779e5727..a2688eeeb4eb1c4fe3f5caccdae416b1643de868 100644 (file)
@@ -434,7 +434,7 @@ static int dev_acquisition_start_1x_2x_rs232(const struct sr_dev_inst *sdi)
        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;
@@ -457,7 +457,7 @@ static int dev_acquisition_start_2x_bd232(const struct sr_dev_inst *sdi)
        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;
@@ -471,7 +471,7 @@ static int dev_acquisition_start_2x_bd232(const struct sr_dev_inst *sdi)
 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 = {
index 656b61e331aa7981cf7f2b9caaaf0db39cf75325..2889a814d2996c0e46eaffaff53d79d22f944f2b 100644 (file)
@@ -229,7 +229,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi)
                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;
        }
index 77058577e44d8584805f623dca855354617f1b38..09ce9ee50861cd0a6e2adcad0eb53cab9632f47a 100644 (file)
@@ -196,7 +196,7 @@ SR_PRIV int gwinstek_gds_800_receive_data(int fd, int revents, void *cb_data)
                        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);
index 4ed9527e5a154a071d023a79505a859a0c572a91..fe32262d4e425cdac18322194da4ff696cffdf37 100644 (file)
@@ -745,7 +745,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        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;
 
@@ -757,7 +757,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi)
        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;
index 5c2a478ad904c5870e715181f4840ab2a817fd89..27eacf4a2802c8267a9d7b8738a4fc9c67409232 100644 (file)
@@ -739,7 +739,7 @@ static int handle_event(int fd, int revents, void *cb_data)
                 */
                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;
 
@@ -768,7 +768,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        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;
index eb6c8b631b8705ea1309b7d9e7e527d5c72d2bac..1604a18c682a2559fc62bde3fe4a269adb621825 100644 (file)
@@ -862,7 +862,7 @@ static int handle_event(int fd, int revents, void *cb_data)
                 */
                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;
 
@@ -971,7 +971,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        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;
 }
index 16b44a77a4a4ce44515d7456cb5b0fbd867c80fe..3bcc723bd59742438c4e7c9889162077e56610e0 100644 (file)
@@ -378,7 +378,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        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;
index 842bdc212bfecce7872b81f3e7fc4bd7947542c6..56acd856eb620e447a1460b87ed173b44865169c 100644 (file)
@@ -682,7 +682,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        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);
@@ -695,7 +695,7 @@ SR_PRIV int hung_chang_dso_2100_dev_acquisition_stop(const struct sr_dev_inst *s
        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);
 
index 2d194abd5bfe180869ac065cb6e03e8db5368b81..c82422a553ed38dc1a6bf7c810130e6812727643 100644 (file)
@@ -434,7 +434,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
 
        sr_dbg("Acquisition started successfully.");
 
-       std_session_send_df_header(sdi, LOG_PREFIX);
+       std_session_send_df_header(sdi);
 
        devc->next_state = STATE_SAMPLE;
 
index 621fb000e53a161dca0409847296a3fe4b7129d7..45d60db507855837b000e36bf64acc4988e88ea5 100644 (file)
@@ -28,7 +28,7 @@ static void stop_acquisition(struct sr_dev_inst *sdi)
 
        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;
 }
@@ -39,7 +39,7 @@ static void abort_acquisition(struct sr_dev_inst *sdi)
 
        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);
 }
index fc54ae431a3dc4d4febf7b3d364aa45ad79c1e25..af33244dedb7b00adbfada8acad7509dd160ae97 100644 (file)
@@ -349,7 +349,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *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);
@@ -361,7 +361,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *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;
 }
index 4dacfdc0f90bbb8d6a9312dcd42837754d537d1e..a4e62619600bca84ba82924612a6119e436c1b5b 100644 (file)
@@ -389,7 +389,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
 
        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. */
@@ -412,7 +412,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
                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;
                }
 
index 644d9677784addd0f173301250179a47a2b99065..968ef6968872f86e46b074483d56f122a5a83097 100644 (file)
@@ -51,7 +51,7 @@ SR_PRIV int kecheng_kc_330b_handle_events(int fd, int revents, void *cb_data)
        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;
        }
index 7fa66bb3a8c498d58ce27b9e1b37478090bcbbd9..1af8362aeb9ebd1673cfe2eebcdcbf10a89ce6f7 100644 (file)
@@ -165,7 +165,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        /* 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,
@@ -177,7 +177,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
 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, \
index 15cc52944f25331e8b0b6f6b55815b66c4b54a42..82a75376f63b1f262f2968fc032327e2aa6ee571 100644 (file)
@@ -348,7 +348,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        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;
@@ -366,7 +366,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi)
                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 = {
index 32bb958bce913a6c1a8f36cc3c56bd13547deb52..405c8f923053d4f3be29580144919dcaf17860c1 100644 (file)
@@ -305,7 +305,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
 
        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;
@@ -317,7 +317,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
 
        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;
        }
 
index ceaf9d72d34cce64760d0bdc95ab5df6ae95ac99..1b6a0ad55e5ddf60992a72607d0323129fff1efd 100644 (file)
@@ -491,7 +491,7 @@ SR_PRIV int lascar_el_usb_handle_events(int fd, int revents, void *cb_data)
 
        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));
index 60325fe4b66bd23ff3d84f548de6630eb0f8e871..db423e4b749c29f01b2e7639bb3bf2308d4f571f 100644 (file)
@@ -480,7 +480,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        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);
index 11d3ce2c201cb2100f65b3bd06c5603f9623c59b..78376a45ef1747c2a5e070edd516c278e803bc1c 100644 (file)
@@ -918,7 +918,7 @@ static void LIBUSB_CALL recv_intr_transfer(struct libusb_transfer *xfer)
        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;
        }
@@ -1089,7 +1089,7 @@ static void LIBUSB_CALL recv_bulk_transfer(struct libusb_transfer *xfer)
                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,
index a3b00869b76ad34c488fdc2d015314fa0ffece96..7924b2311a2b1a4f72b056f37253682454243a8d 100644 (file)
@@ -380,7 +380,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        /* 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. */
index 5c263adb89317f3f2fee066c4df3c89ccdef779b..3952dd99635435b6cd4ae2a6a325500f8563ef3e 100644 (file)
@@ -289,7 +289,7 @@ SR_PRIV void stop_acquisition(const struct sr_dev_inst *sdi)
        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)
index 6b6b12e4d1899c8b80b3a17f323fd7c47e931f9a..c7394e361beeb531960159511802de1c8f4689b1 100644 (file)
@@ -356,7 +356,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        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;
@@ -372,7 +372,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
 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 = {
index 84e90b5e7bcd7e7d0e4fa4d06a18bae52e7c649a..682254315429732f14697e59b38369e03ce0fdb4 100644 (file)
@@ -445,7 +445,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
                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);
 }
@@ -457,7 +457,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *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);
index f12aa845a62529cd88c6cf681894f4a33cc1c0b8..510dbb819e7dd2a6d2003b6e314317a02aba4aa7 100644 (file)
@@ -185,7 +185,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, int idx)
        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;
@@ -198,7 +198,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, int idx)
 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 */
index abc53ce3b87702f3648fe5a0c42ae5160574346a..59061530af4b0ffbe3c67d96a63519ae1bdc2ee0 100644 (file)
@@ -770,7 +770,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        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);
 
@@ -783,7 +783,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
 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 = {
index 04e16a5537d42311726affd85f4a2bf7ef6e1814..0fcfff8fb5416ea86550a26c657840d8e058c0a3 100644 (file)
@@ -209,7 +209,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        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;
@@ -222,7 +222,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
 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 = {
index 970d4a61dff3d6354f030c987e4b3a7da3c100d1..1e22c5b82f97970c9a83e00c36419d47071ad583 100644 (file)
@@ -543,7 +543,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        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.
index f88729d573039467bfc63d91e83e44efc0d3bbeb..a7c3f96376044b5b7b3e48eb3152b5ef53ad5f3a 100644 (file)
@@ -317,7 +317,7 @@ SR_PRIV void abort_acquisition(const struct sr_dev_inst *sdi)
        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)
index 57f49bf6e4dd6219ba76b92eb345e05f51529550..e53723c7873cdfb285dc2acb674f1ef9ce293149 100644 (file)
@@ -309,7 +309,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        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;
@@ -322,7 +322,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
 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 = {
index 91c7dc2f17a11c3a22b8e3e3ad258c69e2b11d2c..ca050bf633700f438677d2aa8014ecdd99802ad3 100644 (file)
@@ -667,7 +667,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        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,
@@ -691,7 +691,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi)
 
        sr_session_source_remove(sdi->session, -1);
 
-       std_session_send_df_end(sdi, LOG_PREFIX);
+       std_session_send_df_end(sdi);
 
        return SR_OK;
 }
index 6668d9cd63113e6faeace2983eecfa0cdeef02f3..4d105381bc38dba1759cb2ba0f932eeea3865e72 100644 (file)
@@ -1018,7 +1018,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        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;
 
@@ -1044,7 +1044,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi)
                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;
index 3eb9f4034364b882e30cfeefadbf9bdc706bf298..3597d3f1245357ca7f24e3c1f96defe930df4fea 100644 (file)
@@ -761,7 +761,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
 
        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);
index 997a829a0190b6ce4de1213ec4790828f6ca99d1..28a4c52f387a04f41ec91a97ea7a542f8e818fc8 100644 (file)
@@ -753,7 +753,7 @@ static void finish_acquisition(struct sr_dev_inst *sdi)
 
        devc = sdi->priv;
 
-       std_session_send_df_end(sdi, LOG_PREFIX);
+       std_session_send_df_end(sdi);
 
        usb_source_remove(sdi->session, devc->ctx);
 
index ad3d0a379ea89a7e233d954181e645d8ed117151..5bce3af0d3f092bb35b861c06c5b1f60b9d5d6c4 100644 (file)
@@ -652,7 +652,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        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);
@@ -692,7 +692,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi)
        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;
 }
index af70fc302a0a7c811a0b7a7f4958e0dcaa403f46..7cd444fb188ec72d44dbf92aa60f20316aeb5ae9 100644 (file)
@@ -185,7 +185,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        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;
@@ -198,7 +198,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
 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, \
index b4c3171e240ceb73dc3cbc3337085045a4efa534..986aa6121d55a57877ef71c99371811193ab487a 100644 (file)
@@ -316,7 +316,7 @@ static int transfer_event(int fd, int revents, void *cb_data)
 
        /* 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;
 }
@@ -574,7 +574,7 @@ SR_PRIV int lwla_start_acquisition(const struct sr_dev_inst *sdi)
        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);
index 8934433764cd0a57756d2bcbb23a9498868ea53f..d234bb10bba8ce1282c495671a1e7c221a42f03d 100644 (file)
@@ -170,7 +170,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
 
        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,
@@ -182,7 +182,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
 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 = {
index 4d9a7a42a6469294db89e1130c1cdfd30c42ac51..2f44eaad16cad319102a7530ccc671b2e2ee9996 100644 (file)
@@ -352,7 +352,7 @@ static int handle_events(int fd, int revents, void *cb_data)
        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));
@@ -381,7 +381,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        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);
index 0e1c680fdc865edcc5f5f3da9c651121f530313a..d2ef328863a6a29be7a670d96101d1929e47ac49 100644 (file)
@@ -137,7 +137,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *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);
 
@@ -152,7 +152,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
 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 = {
index 02e301cc2a7841ab8d149adb8a63af6b84e2b901..97d079f5dc505007d6c291c080ed51d44aaaa3df 100644 (file)
@@ -164,7 +164,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
 
        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);
@@ -175,7 +175,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *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;
index bc4ad43816004da970501cf8a417a74d7679b1a0..8e84c2c109aaa1ab1426a053b2c3aebf13eb4d3f 100644 (file)
@@ -254,7 +254,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
                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;
index 4287e3932751610e324409bc06446117404909a5..0b4d2da2f763310f16305a4edd4593118c96d1fb 100644 (file)
@@ -215,7 +215,7 @@ SR_PRIV int uni_t_ut32x_handle_events(int fd, int revents, void *cb_data)
 
        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;
index 3a132a179ca13d1ea451a7a8850080bd7ec6b3f5..b55020433f2554a66ecc831b71359f0be3c70eb6 100644 (file)
@@ -273,7 +273,7 @@ static int handle_events(int fd, int revents, void *cb_data)
        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));
@@ -297,7 +297,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
 
        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);
index 103bb03054cca6ceeb46bc18061c7f2d26d743e1..99647913c4d9417bb493d7f161bd16f5dc00a449 100644 (file)
@@ -660,7 +660,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *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;
index 547d8152c91d1a576f9d6cdcafe39f5b03655fa4..b2fe6079a676d19dd648e8435032a0d130a45463 100644 (file)
@@ -522,11 +522,11 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        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;
        }
 
@@ -634,7 +634,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        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;
 }
@@ -644,7 +644,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi)
 {
        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);
index e693f581f78872b99502d3e3374039b38d6587a5..4984edb0b0aa37b9d8145cf9acda08e01ea981dd 100644 (file)
@@ -75,7 +75,7 @@ static int process_buffer(struct sr_input *in)
 
        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;
@@ -137,7 +137,7 @@ static int end(struct sr_input *in)
 
        inc = in->priv;
        if (inc->started)
-               std_session_send_df_end(in->sdi, LOG_PREFIX);
+               std_session_send_df_end(in->sdi);
 
        return ret;
 }
index 48c04b90eab07a84be941ff0cf393d5939dd9745..9c7b2205c57f77036001d221acd8a47c53139fcc 100644 (file)
@@ -87,7 +87,7 @@ static int process_buffer(struct sr_input *in)
 
        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;
@@ -149,7 +149,7 @@ static int end(struct sr_input *in)
 
        inc = in->priv;
        if (inc->started)
-               std_session_send_df_end(in->sdi, LOG_PREFIX);
+               std_session_send_df_end(in->sdi);
 
        return ret;
 }
index a8c689443a35430712b05a0099434d7c386e6031..1eb20bff72691bbf97ccf9bc8b0a637d47a76cd0 100644 (file)
@@ -612,7 +612,7 @@ static int process_buffer(struct sr_input *in)
 
        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;
@@ -747,7 +747,7 @@ static int end(struct sr_input *in)
 
        inc = in->priv;
        if (inc->started)
-               std_session_send_df_end(in->sdi, LOG_PREFIX);
+               std_session_send_df_end(in->sdi);
 
        return ret;
 }
index 5241e74ca5261c005861ac3eca15f2d198523710..9c7135f0622aacfd9a6b2177f3ce316f53d66bad 100644 (file)
@@ -151,7 +151,7 @@ static int process_buffer(struct sr_input *in)
 
        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;
@@ -227,7 +227,7 @@ static int end(struct sr_input *in)
 
        inc = in->priv;
        if (inc->started)
-               std_session_send_df_end(in->sdi, LOG_PREFIX);
+               std_session_send_df_end(in->sdi);
 
        return ret;
 }
index 4c991a987ca74e094d255d34d0f0a799260d3da9..a9b1ca4f53e09c9b3a02eeed912bbf8174c8291a 100644 (file)
@@ -683,7 +683,7 @@ static int process_buffer(struct sr_input *in)
        }
 
        if (!inc->meta_sent) {
-               std_session_send_df_header(in->sdi, LOG_PREFIX);
+               std_session_send_df_header(in->sdi);
                send_metadata(in);
        }
 
@@ -751,7 +751,7 @@ static int end(struct sr_input *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;
 }
index 39a92d32509cf510b59c624bcde2e4f55689584f..3b8aba8206b71e64a048df2b1c7b3ed1b874de95 100644 (file)
@@ -530,7 +530,7 @@ static int process_buffer(struct sr_input *in)
 
        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;
@@ -596,7 +596,7 @@ static int end(struct sr_input *in)
        send_buffer(in);
 
        if (inc->started)
-               std_session_send_df_end(in->sdi, LOG_PREFIX);
+               std_session_send_df_end(in->sdi);
 
        return ret;
 }
index 0f56a4ad570c195f8f02b12eaeca8dae5e3c43af..a07fcd100ce51b2d09b22f523c5eae90d1f1acaf 100644 (file)
@@ -245,7 +245,7 @@ static int process_buffer(struct sr_input *in)
 
        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;
@@ -351,7 +351,7 @@ static int end(struct sr_input *in)
 
        inc = in->priv;
        if (inc->started)
-               std_session_send_df_end(in->sdi, LOG_PREFIX);
+               std_session_send_df_end(in->sdi);
 
        return ret;
 }
index 3b32df1ed38dd6234783e6ea48b31c30026f3b96..d4b802dba9bed0b88f20dbde4e428b3f60add167 100644 (file)
@@ -914,7 +914,7 @@ SR_PRIV int es51919_serial_acquisition_start(const struct sr_dev_inst *sdi)
        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;
@@ -927,5 +927,5 @@ SR_PRIV int es51919_serial_acquisition_start(const struct sr_dev_inst *sdi)
 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);
 }
index ad578e98244ae3b3f47452377daf02279c6b3c14..2ffffd3d59e260440da8a21c02a8c2f469d3a9c8 100644 (file)
@@ -928,12 +928,10 @@ SR_PRIV int std_cleanup(const struct sr_dev_driver *di);
 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);
index c275122367778d24b17efb3a1be9d9f30f95262b..3aabffa2ecbd59cb11596386a7c44b2404ae3852 100644 (file)
@@ -199,7 +199,7 @@ static int receive_data(int fd, int revents, void *cb_data)
                vdev->archive = NULL;
        }
 
-       std_session_send_df_end(sdi, LOG_PREFIX);
+       std_session_send_df_end(sdi);
 
        return G_SOURCE_REMOVE;
 }
@@ -360,7 +360,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
                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);
index fa668a7c8eba8efc552dbdf28610641d9f440df9..70632319ef149fcde245b3a386a0126424c86927 100644 (file)
--- a/src/std.c
+++ b/src/std.c
@@ -85,24 +85,17 @@ SR_PRIV int std_cleanup(const struct sr_dev_driver *di)
  * 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. */
@@ -124,19 +117,17 @@ SR_PRIV int std_session_send_df_header(const struct sr_dev_inst *sdi,
  * 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);
@@ -217,8 +208,6 @@ SR_PRIV int std_serial_dev_close(struct sr_dev_inst *sdi)
  *                       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.
@@ -227,15 +216,11 @@ SR_PRIV int std_serial_dev_close(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)
 {
+       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;
@@ -253,7 +238,7 @@ SR_PRIV int std_serial_dev_acquisition_stop(struct sr_dev_inst *sdi,
                return ret;
        }
 
-       std_session_send_df_end(sdi, prefix);
+       std_session_send_df_end(sdi);
 
        return SR_OK;
 }