]> sigrok.org Git - libsigrok.git/commitdiff
hameg-hmo: Use hmo_ prefix for driver-local SR_PRIV functions.
authorUwe Hermann <redacted>
Tue, 3 Dec 2013 15:58:34 +0000 (16:58 +0100)
committerUwe Hermann <redacted>
Tue, 3 Dec 2013 15:58:34 +0000 (16:58 +0100)
hardware/hameg-hmo/api.c
hardware/hameg-hmo/protocol.c
hardware/hameg-hmo/protocol.h

index 37e458afd42dc2a7503d3ee2a1983367ebabacd8..1663a5f339a4da89658966561df637d21ba16367 100644 (file)
@@ -38,6 +38,13 @@ static struct usb_id_info ho_models[] = {
        { 0x0403, 0xed73 }, /* HO730 */
 };
 
+enum {
+       PG_INVALID = -1,
+       PG_NONE,
+       PG_ANALOG,
+       PG_DIGITAL,
+};
+
 static int init(struct sr_context *sr_ctx)
 {
        return std_init(sr_ctx, di, LOG_PREFIX);
@@ -197,7 +204,7 @@ static GSList *scan(GSList *options)
 
        if (sr_serial_extract_options(options, &serial_device,
                                      &serial_options) == SR_OK) {
-               sdi = hameg_probe_serial_device(serial_device, serial_options);
+               sdi = hmo_probe_serial_device(serial_device, serial_options);
                if (sdi != NULL) {
                        devices = g_slist_append(devices, sdi);
                        drvc->instances = g_slist_append(drvc->instances, sdi);
@@ -213,7 +220,7 @@ static GSList *scan(GSList *options)
                }
 
                for (l = tty_devs; l; l = l->next) {
-                       sdi = hameg_probe_serial_device(l->data, serial_options);
+                       sdi = hmo_probe_serial_device(l->data, serial_options);
                        if (sdi != NULL) {
                                devices = g_slist_append(devices, sdi);
                                drvc->instances = g_slist_append(drvc->instances, sdi);
@@ -240,7 +247,7 @@ static void clear_helper(void *priv)
        devc = priv;
        model = devc->model_config;
 
-       scope_state_free(devc->model_state);
+       hmo_scope_state_free(devc->model_state);
 
        for (i = 0; i < model->analog_channels; ++i)
                g_slist_free(devc->analog_groups[i].probes);
@@ -267,7 +274,7 @@ static int dev_open(struct sr_dev_inst *sdi)
            serial_open(sdi->conn, SERIAL_RDWR | SERIAL_NONBLOCK) != SR_OK)
                return SR_ERR;
 
-       if (scope_state_get(sdi) != SR_OK)
+       if (hmo_scope_state_get(sdi) != SR_OK)
                return SR_ERR;
 
        sdi->status = SR_ST_ACTIVE;
@@ -778,7 +785,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
                return SR_ERR;
        }
 
-       sr_source_add(serial->fd, G_IO_IN, 50, hameg_hmo_receive_data, (void *)sdi);
+       sr_source_add(serial->fd, G_IO_IN, 50, hmo_receive_data, (void *)sdi);
 
        /* Send header packet to the session bus. */
        std_session_send_df_header(cb_data, LOG_PREFIX);
index 68ab39cb69ced984ecf0f8f23dbee32b14fe3d5f..d76a6778e6d80dc7922f07b3a7caf53977a0b883 100644 (file)
@@ -398,7 +398,7 @@ static int digital_channel_state_get(struct sr_serial_dev_inst *serial,
        return SR_OK;
 }
 
-SR_PRIV int scope_state_get(struct sr_dev_inst *sdi)
+SR_PRIV int hmo_scope_state_get(struct sr_dev_inst *sdi)
 {
        struct dev_context *devc;
        struct scope_state *state;
@@ -473,7 +473,7 @@ fail:
        return NULL;
 }
 
-SR_PRIV void scope_state_free(struct scope_state *state)
+SR_PRIV void hmo_scope_state_free(struct scope_state *state)
 {
        g_free(state->analog_channels);
        g_free(state->digital_channels);
@@ -560,8 +560,8 @@ SR_PRIV int hmo_init_device(struct sr_dev_inst *sdi)
        return SR_OK;
 }
 
-SR_PRIV struct sr_dev_inst *hameg_probe_serial_device(const char *serial_device,
-                                                     const char *serial_options)
+SR_PRIV struct sr_dev_inst *hmo_probe_serial_device(const char *serial_device,
+                                                   const char *serial_options)
 {
        struct sr_dev_inst *sdi;
        struct dev_context *devc;
@@ -622,7 +622,7 @@ fail:
        return NULL;
 }
 
-SR_PRIV int hameg_hmo_receive_data(int fd, int revents, void *cb_data)
+SR_PRIV int hmo_receive_data(int fd, int revents, void *cb_data)
 {
        struct sr_probe *probe;
        struct sr_dev_inst *sdi;
index 9f27f01b899e3b6c296c1d5d1bbffce147dabab1..ff3b398208ab2c7997ef921d846eff537b953db5 100644 (file)
 SR_PRIV struct sr_dev_driver hameg_hmo_driver_info;
 static struct sr_dev_driver *di = &hameg_hmo_driver_info;
 
-enum {
-       PG_INVALID = -1,
-       PG_NONE,
-       PG_ANALOG,
-       PG_DIGITAL,
-};
-
 struct scope_config {
        const char *name[MAX_INSTRUMENT_VERSIONS];
        const uint8_t analog_channels;
@@ -121,12 +114,12 @@ struct dev_context {
 
 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 hameg_hmo_receive_data(int fd, int revents, void *cb_data);
-SR_PRIV struct sr_dev_inst *hameg_probe_serial_device(const char *serial_device,
-                                                     const char *serial_options);
+SR_PRIV int hmo_receive_data(int fd, int revents, void *cb_data);
+SR_PRIV struct sr_dev_inst *hmo_probe_serial_device(const char *serial_device,
+                                                   const char *serial_options);
 
-SR_PRIV struct scope_state *scope_state_new(struct scope_config *config);
-SR_PRIV void scope_state_free(struct scope_state *state);
-SR_PRIV int scope_state_get(struct sr_dev_inst *sdi);
+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);
 
 #endif