This patch renames the "hameg-hmo" driver to the updated
name "rohde-schwarz-hameg", in order to reflect the new
branding and the extended range of supported devices.

Signed-off-by: Guido Trentalancia <gu...@trentalancia.com>
---
 Makefile.am                                 |    8 ++--
 README.devices                              |    6 +--
 configure.ac                                |    2 -
 src/hardware/rohde-schwarz-hameg/api.c      |   38 +++++++++++------------
 src/hardware/rohde-schwarz-hameg/protocol.c |   46 ++++++++++++++--------------
 src/hardware/rohde-schwarz-hameg/protocol.h |   20 ++++++------
 6 files changed, 60 insertions(+), 60 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 8d904f9..1bff338 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -335,11 +335,11 @@ src_libdrivers_la_SOURCES += \
        src/hardware/gwinstek-gpd/protocol.c \
        src/hardware/gwinstek-gpd/api.c
 endif
-if HW_HAMEG_HMO
+if HW_ROHDE_SCHWARZ_HAMEG
 src_libdrivers_la_SOURCES += \
-       src/hardware/hameg-hmo/protocol.h \
-       src/hardware/hameg-hmo/protocol.c \
-       src/hardware/hameg-hmo/api.c
+       src/hardware/rohde-schwarz-hameg/protocol.h \
+       src/hardware/rohde-schwarz-hameg/protocol.c \
+       src/hardware/rohde-schwarz-hameg/api.c
 endif
 if HW_HANTEK_4032L
 src_libdrivers_la_SOURCES += \
diff --git a/README.devices b/README.devices
index a8ec45a..547e8ad 100644
--- a/README.devices
+++ b/README.devices
@@ -94,7 +94,7 @@ The following drivers/devices do not need any firmware upload:
  - ftdi-la
  - gmc-mh-1x-2x (including all subdrivers)
  - gwinstek-gds-800
- - hameg-hmo
+ - rohde-schwarz-hameg
  - hp-3457a
  - hung-chang-dso-2100
  - ikalogic-scanalogic2
@@ -153,7 +153,7 @@ the drivers implement a default for the connection.
  - conrad-digi-35-cpu
  - fluke-dmm
  - gmc-mh-1x-2x (including all subdrivers)
- - hameg-hmo
+ - rohde-schwarz-hameg
  - link-mso19
  - mic-985xx (including all subdrivers)
  - norma-dmm
@@ -197,7 +197,7 @@ or VXI communication parameters. See these examples:
 
 The following drivers/devices accept network communication parameters:
 
- - hameg-hmo
+ - rohde-schwarz-hameg
  - rigol-ds
  - siglent-sds
  - yokogawa-dlm
diff --git a/configure.ac b/configure.ac
index b2b928c..2805ea2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -241,7 +241,6 @@ SR_DRIVER([fx2lafw], [fx2lafw], [libusb])
 SR_DRIVER([GMC MH 1x/2x], [gmc-mh-1x-2x], [libserialport])
 SR_DRIVER([GW Instek GDS-800], [gwinstek-gds-800], [libserialport])
 SR_DRIVER([GW Instek GPD], [gwinstek-gpd], [libserialport])
-SR_DRIVER([Hameg HMO], [hameg-hmo], [libserialport])
 SR_DRIVER([Hantek 4032L], [hantek-4032l], [libusb])
 SR_DRIVER([Hantek 6xxx], [hantek-6xxx], [libusb])
 SR_DRIVER([Hantek DSO], [hantek-dso], [libusb])
@@ -267,6 +266,7 @@ SR_DRIVER([PCE PCE-322A], [pce-322a], [libserialport])
 SR_DRIVER([Pipistrello-OLS], [pipistrello-ols], [libftdi])
 SR_DRIVER([RDTech DPSxxxx/DPHxxxx], [rdtech-dps], [libserialport])
 SR_DRIVER([Rigol DS], [rigol-ds])
+SR_DRIVER([Rohde&Schwarz / Hameg oscilloscope], [rohde-schwarz-hameg], 
[libserialport])
 SR_DRIVER([Rohde&Schwarz SME-0x], [rohde-schwarz-sme-0x], [libserialport])
 SR_DRIVER([Saleae Logic16], [saleae-logic16], [libusb])
 SR_DRIVER([Saleae Logic Pro], [saleae-logic-pro], [libusb])
diff --git a/src/hardware/hameg-hmo/api.c 
b/src/hardware/rohde-schwarz-hameg/api.c
similarity index 96%
rename from src/hardware/hameg-hmo/api.c
rename to src/hardware/rohde-schwarz-hameg/api.c
index a720421..7d0063c 100644
--- a/src/hardware/hameg-hmo/api.c
+++ b/src/hardware/rohde-schwarz-hameg/api.c
@@ -23,11 +23,11 @@
 #include "scpi.h"
 #include "protocol.h"
 
-static struct sr_dev_driver hameg_hmo_driver_info;
+static struct sr_dev_driver rohde_schwarz_driver_info;
 
 static const char *manufacturers[] = {
-       "HAMEG",
        "Rohde&Schwarz",
+       "HAMEG",
 };
 
 static const uint32_t scanopts[] = {
@@ -69,7 +69,7 @@ static struct sr_dev_inst *probe_device(struct 
sr_scpi_dev_inst *scpi)
        sdi->model = g_strdup(hw_info->model);
        sdi->version = g_strdup(hw_info->firmware_version);
        sdi->serial_num = g_strdup(hw_info->serial_number);
-       sdi->driver = &hameg_hmo_driver_info;
+       sdi->driver = &rohde_schwarz_driver_info;
        sdi->inst_type = SR_INST_SCPI;
        sdi->conn = scpi;
 
@@ -80,7 +80,7 @@ static struct sr_dev_inst *probe_device(struct 
sr_scpi_dev_inst *scpi)
 
        sdi->priv = devc;
 
-       if (hmo_init_device(sdi) != SR_OK)
+       if (rs_init_device(sdi) != SR_OK)
                goto fail;
 
        return sdi;
@@ -100,7 +100,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList 
*options)
 
 static void clear_helper(struct dev_context *devc)
 {
-       hmo_scope_state_free(devc->model_state);
+       rs_scope_state_free(devc->model_state);
        g_free(devc->analog_groups);
        g_free(devc->digital_groups);
 }
@@ -115,7 +115,7 @@ static int dev_open(struct sr_dev_inst *sdi)
        if (sr_scpi_open(sdi->conn) != SR_OK)
                return SR_ERR;
 
-       if (hmo_scope_state_get(sdi) != SR_OK)
+       if (rs_scope_state_get(sdi) != SR_OK)
                return SR_ERR;
 
        return SR_OK;
@@ -441,7 +441,7 @@ static int config_set(uint32_t key, GVariant *data,
        }
 
        if (ret == SR_OK && update_sample_rate)
-               ret = hmo_update_sample_rate(sdi);
+               ret = rs_update_sample_rate(sdi);
 
        return ret;
 }
@@ -522,7 +522,7 @@ static int config_list(uint32_t key, GVariant **data,
        return SR_OK;
 }
 
-SR_PRIV int hmo_request_data(const struct sr_dev_inst *sdi)
+SR_PRIV int rs_request_data(const struct sr_dev_inst *sdi)
 {
        char command[MAX_COMMAND_SIZE];
        struct sr_channel *ch;
@@ -558,7 +558,7 @@ SR_PRIV int hmo_request_data(const struct sr_dev_inst *sdi)
        return sr_scpi_send(sdi->conn, command);
 }
 
-static int hmo_check_channels(GSList *channels)
+static int rs_check_channels(GSList *channels)
 {
        GSList *l;
        struct sr_channel *ch;
@@ -609,7 +609,7 @@ static int hmo_check_channels(GSList *channels)
        return SR_OK;
 }
 
-static int hmo_setup_channels(const struct sr_dev_inst *sdi)
+static int rs_setup_channels(const struct sr_dev_inst *sdi)
 {
        GSList *l;
        unsigned int i;
@@ -693,7 +693,7 @@ static int hmo_setup_channels(const struct sr_dev_inst *sdi)
        if (ret != SR_OK)
                return ret;
 
-       if (setup_changed && hmo_update_sample_rate(sdi) != SR_OK)
+       if (setup_changed && rs_update_sample_rate(sdi) != SR_OK)
                return SR_ERR;
 
        return SR_OK;
@@ -751,7 +751,7 @@ static int dev_acquisition_start(const struct sr_dev_inst 
*sdi)
         * Check constraints. Some channels can be either analog or
         * digital, but not both at the same time.
         */
-       if (hmo_check_channels(devc->enabled_channels) != SR_OK) {
+       if (rs_check_channels(devc->enabled_channels) != SR_OK) {
                sr_err("Invalid channel configuration specified!");
                ret = SR_ERR_NA;
                goto free_enabled;
@@ -761,7 +761,7 @@ static int dev_acquisition_start(const struct sr_dev_inst 
*sdi)
         * Configure the analog and digital channels and the
         * corresponding digital pods.
         */
-       if (hmo_setup_channels(sdi) != SR_OK) {
+       if (rs_setup_channels(sdi) != SR_OK) {
                sr_err("Failed to setup channel configuration!");
                ret = SR_ERR;
                goto free_enabled;
@@ -772,13 +772,13 @@ static int dev_acquisition_start(const struct sr_dev_inst 
*sdi)
         * receive routine will continue driving the acquisition.
         */
        sr_scpi_source_add(sdi->session, scpi, G_IO_IN, 50,
-                       hmo_receive_data, (void *)sdi);
+                       rs_receive_data, (void *)sdi);
 
        std_session_send_df_header(sdi);
 
        devc->current_channel = devc->enabled_channels;
 
-       return hmo_request_data(sdi);
+       return rs_request_data(sdi);
 
 free_enabled:
        g_slist_free(devc->enabled_channels);
@@ -805,9 +805,9 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi)
        return SR_OK;
 }
 
-static struct sr_dev_driver hameg_hmo_driver_info = {
-       .name = "hameg-hmo",
-       .longname = "Hameg HMO",
+static struct sr_dev_driver rohde_schwarz_driver_info = {
+       .name = "rohde-schwarz-hameg",
+       .longname = "Rohde&Schwarz / Hameg oscilloscope",
        .api_version = 1,
        .init = std_init,
        .cleanup = std_cleanup,
@@ -823,4 +823,4 @@ static struct sr_dev_driver hameg_hmo_driver_info = {
        .dev_acquisition_stop = dev_acquisition_stop,
        .context = NULL,
 };
-SR_REGISTER_DEV_DRIVER(hameg_hmo_driver_info);
+SR_REGISTER_DEV_DRIVER(rohde_schwarz_driver_info);
diff --git a/src/hardware/hameg-hmo/protocol.c 
b/src/hardware/rohde-schwarz-hameg/protocol.c
similarity index 96%
rename from src/hardware/hameg-hmo/protocol.c
rename to src/hardware/rohde-schwarz-hameg/protocol.c
index ff4f193..89d4565 100644
--- a/src/hardware/hameg-hmo/protocol.c
+++ b/src/hardware/rohde-schwarz-hameg/protocol.c
@@ -24,13 +24,13 @@
 #include "scpi.h"
 #include "protocol.h"
 
-SR_PRIV void hmo_queue_logic_data(struct dev_context *devc,
+SR_PRIV void rs_queue_logic_data(struct dev_context *devc,
                                  size_t group, GByteArray *pod_data);
-SR_PRIV void hmo_send_logic_packet(struct sr_dev_inst *sdi,
+SR_PRIV void rs_send_logic_packet(struct sr_dev_inst *sdi,
                                   struct dev_context *devc);
-SR_PRIV void hmo_cleanup_logic_data(struct dev_context *devc);
+SR_PRIV void rs_cleanup_logic_data(struct dev_context *devc);
 
-static const char *hameg_scpi_dialect[] = {
+static const char *rohde_schwarz_scpi_dialect[] = {
        [SCPI_CMD_GET_DIG_DATA]               = ":FORM UINT,8;:POD%d:DATA?",
        [SCPI_CMD_GET_TIMEBASE]               = ":TIM:SCAL?",
        [SCPI_CMD_SET_TIMEBASE]               = ":TIM:SCAL %s",
@@ -253,7 +253,7 @@ static const struct scope_config scope_models[] = {
                .num_xdivs = 12,
                .num_ydivs = 8,
 
-               .scpi_dialect = &hameg_scpi_dialect,
+               .scpi_dialect = &rohde_schwarz_scpi_dialect,
        },
        {
                /* HMO3032/3042/3052/3522 support 16 digital channels. */
@@ -295,7 +295,7 @@ static const struct scope_config scope_models[] = {
                .num_xdivs = 12,
                .num_ydivs = 8,
 
-               .scpi_dialect = &hameg_scpi_dialect,
+               .scpi_dialect = &rohde_schwarz_scpi_dialect,
        },
        {
                .name = {"HMO724", "HMO1024", "HMO1524", "HMO2024", NULL},
@@ -336,7 +336,7 @@ static const struct scope_config scope_models[] = {
                .num_xdivs = 12,
                .num_ydivs = 8,
 
-               .scpi_dialect = &hameg_scpi_dialect,
+               .scpi_dialect = &rohde_schwarz_scpi_dialect,
        },
        {
                .name = {"HMO2524", "HMO3034", "HMO3044", "HMO3054", "HMO3524", 
NULL},
@@ -377,7 +377,7 @@ static const struct scope_config scope_models[] = {
                .num_xdivs = 12,
                .num_ydivs = 8,
 
-               .scpi_dialect = &hameg_scpi_dialect,
+               .scpi_dialect = &rohde_schwarz_scpi_dialect,
        },
 };
 
@@ -659,7 +659,7 @@ exit:
        return result;
 }
 
-SR_PRIV int hmo_update_sample_rate(const struct sr_dev_inst *sdi)
+SR_PRIV int rs_update_sample_rate(const struct sr_dev_inst *sdi)
 {
        struct dev_context *devc;
        struct scope_state *state;
@@ -680,7 +680,7 @@ SR_PRIV int hmo_update_sample_rate(const struct sr_dev_inst 
*sdi)
        return SR_OK;
 }
 
-SR_PRIV int hmo_scope_state_get(struct sr_dev_inst *sdi)
+SR_PRIV int rs_scope_state_get(struct sr_dev_inst *sdi)
 {
        struct dev_context *devc;
        struct scope_state *state;
@@ -747,7 +747,7 @@ SR_PRIV int hmo_scope_state_get(struct sr_dev_inst *sdi)
                               &state->trigger_pattern) != SR_OK)
                return SR_ERR;
 
-       if (hmo_update_sample_rate(sdi) != SR_OK)
+       if (rs_update_sample_rate(sdi) != SR_OK)
                return SR_ERR;
 
        sr_info("Fetching finished.");
@@ -772,7 +772,7 @@ static struct scope_state *scope_state_new(const struct 
scope_config *config)
        return state;
 }
 
-SR_PRIV void hmo_scope_state_free(struct scope_state *state)
+SR_PRIV void rs_scope_state_free(struct scope_state *state)
 {
        g_free(state->analog_channels);
        g_free(state->digital_channels);
@@ -780,7 +780,7 @@ SR_PRIV void hmo_scope_state_free(struct scope_state *state)
        g_free(state);
 }
 
-SR_PRIV int hmo_init_device(struct sr_dev_inst *sdi)
+SR_PRIV int rs_init_device(struct sr_dev_inst *sdi)
 {
        int model_index;
        unsigned int i, j, group;
@@ -869,7 +869,7 @@ SR_PRIV int hmo_init_device(struct sr_dev_inst *sdi)
 }
 
 /* Queue data of one channel group, for later submission. */
-SR_PRIV void hmo_queue_logic_data(struct dev_context *devc,
+SR_PRIV void rs_queue_logic_data(struct dev_context *devc,
                                  size_t group, GByteArray *pod_data)
 {
        size_t size;
@@ -922,7 +922,7 @@ SR_PRIV void hmo_queue_logic_data(struct dev_context *devc,
 }
 
 /* Submit data for all channels, after the individual groups got collected. */
-SR_PRIV void hmo_send_logic_packet(struct sr_dev_inst *sdi,
+SR_PRIV void rs_send_logic_packet(struct sr_dev_inst *sdi,
                                   struct dev_context *devc)
 {
        struct sr_datafeed_packet packet;
@@ -942,7 +942,7 @@ SR_PRIV void hmo_send_logic_packet(struct sr_dev_inst *sdi,
 }
 
 /* Undo previous resource allocation. */
-SR_PRIV void hmo_cleanup_logic_data(struct dev_context *devc)
+SR_PRIV void rs_cleanup_logic_data(struct dev_context *devc)
 {
 
        if (devc->logic_data) {
@@ -955,7 +955,7 @@ SR_PRIV void hmo_cleanup_logic_data(struct dev_context 
*devc)
         */
 }
 
-SR_PRIV int hmo_receive_data(int fd, int revents, void *cb_data)
+SR_PRIV int rs_receive_data(int fd, int revents, void *cb_data)
 {
        struct sr_channel *ch;
        struct sr_dev_inst *sdi;
@@ -1087,7 +1087,7 @@ SR_PRIV int hmo_receive_data(int fd, int revents, void 
*cb_data)
                        sr_session_send(sdi, &packet);
                } else {
                        group = ch->index / 8;
-                       hmo_queue_logic_data(devc, group, data);
+                       rs_queue_logic_data(devc, group, data);
                }
 
                devc->num_samples = data->len / devc->pod_count;
@@ -1106,10 +1106,10 @@ SR_PRIV int hmo_receive_data(int fd, int revents, void 
*cb_data)
         */
        if (devc->current_channel->next) {
                devc->current_channel = devc->current_channel->next;
-               hmo_request_data(sdi);
+               rs_request_data(sdi);
                return TRUE;
        }
-       hmo_send_logic_packet(sdi, devc);
+       rs_send_logic_packet(sdi, devc);
 
        /*
         * Release the logic data storage after each frame. This copes
@@ -1117,7 +1117,7 @@ SR_PRIV int hmo_receive_data(int fd, int revents, void 
*cb_data)
         * this a real constraint when acquiring multiple frames with
         * identical device settings?
         */
-       hmo_cleanup_logic_data(devc);
+       rs_cleanup_logic_data(devc);
 
        packet.type = SR_DF_FRAME_END;
        sr_session_send(sdi, &packet);
@@ -1129,10 +1129,10 @@ SR_PRIV int hmo_receive_data(int fd, int revents, void 
*cb_data)
         */
        if (++devc->num_frames >= devc->frame_limit || devc->num_samples >= 
devc->samples_limit) {
                sr_dev_acquisition_stop(sdi);
-               hmo_cleanup_logic_data(devc);
+               rs_cleanup_logic_data(devc);
        } else {
                devc->current_channel = devc->enabled_channels;
-               hmo_request_data(sdi);
+               rs_request_data(sdi);
        }
 
        return TRUE;
diff --git a/src/hardware/hameg-hmo/protocol.h 
b/src/hardware/rohde-schwarz-hameg/protocol.h
similarity index 83%
rename from src/hardware/hameg-hmo/protocol.h
rename to src/hardware/rohde-schwarz-hameg/protocol.h
index a9f69c6..2d84889 100644
--- a/src/hardware/hameg-hmo/protocol.h
+++ b/src/hardware/rohde-schwarz-hameg/protocol.h
@@ -17,8 +17,8 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LIBSIGROK_HARDWARE_HAMEG_HMO_PROTOCOL_H
-#define LIBSIGROK_HARDWARE_HAMEG_HMO_PROTOCOL_H
+#ifndef LIBSIGROK_HARDWARE_ROHDE_SCHWARZ_PROTOCOL_H
+#define LIBSIGROK_HARDWARE_ROHDE_SCHWARZ_PROTOCOL_H
 
 #include <glib.h>
 #include <stdint.h>
@@ -26,7 +26,7 @@
 #include <libsigrok/libsigrok.h>
 #include "libsigrok-internal.h"
 
-#define LOG_PREFIX "hameg-hmo"
+#define LOG_PREFIX "rohde-schwarz-hameg"
 
 #define MAX_INSTRUMENT_VERSIONS 10
 #define MAX_COMMAND_SIZE 128
@@ -127,13 +127,13 @@ struct dev_context {
        GByteArray *logic_data;
 };
 
-SR_PRIV int hmo_init_device(struct sr_dev_inst *sdi);
-SR_PRIV int hmo_request_data(const struct sr_dev_inst *sdi);
-SR_PRIV int hmo_receive_data(int fd, int revents, void *cb_data);
+SR_PRIV int rs_init_device(struct sr_dev_inst *sdi);
+SR_PRIV int rs_request_data(const struct sr_dev_inst *sdi);
+SR_PRIV int rs_receive_data(int fd, int revents, void *cb_data);
 
-SR_PRIV struct scope_state *hmo_scope_state_new(struct scope_config *config);
-SR_PRIV void hmo_scope_state_free(struct scope_state *state);
-SR_PRIV int hmo_scope_state_get(struct sr_dev_inst *sdi);
-SR_PRIV int hmo_update_sample_rate(const struct sr_dev_inst *sdi);
+SR_PRIV struct scope_state *rs_scope_state_new(struct scope_config *config);
+SR_PRIV void rs_scope_state_free(struct scope_state *state);
+SR_PRIV int rs_scope_state_get(struct sr_dev_inst *sdi);
+SR_PRIV int rs_update_sample_rate(const struct sr_dev_inst *sdi);
 
 #endif


_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to