]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/lecroy-xstream/protocol.c
lecroy-xstream: Use sr_period_string()
[libsigrok.git] / src / hardware / lecroy-xstream / protocol.c
index e3152623ca077d15222fc4d90ae8c2b380f7f964..871ce4d1bf7c4ebfe79e17540247659b2ee7fe53 100644 (file)
@@ -242,8 +242,8 @@ static void scope_state_dump(const struct scope_config *config,
                        tmp, state->analog_channels[i].vertical_offset);
        }
 
-       tmp = sr_period_string_f(1.0/(((float)config->timebases[state->timebase].p) /
-                                     ((float)config->timebases[state->timebase].q)), 0);
+       tmp = sr_period_string(((float)config->timebases[state->timebase].q) /
+                                     ((float)config->timebases[state->timebase].p));
        sr_info("Current timebase: %s", tmp);
        g_free(tmp);
 
@@ -409,6 +409,7 @@ SR_PRIV int lecroy_xstream_state_get(struct sr_dev_inst *sdi)
        if (sr_scpi_get_string(sdi->conn, "TRIG_SELECT?", &tmp_str) != SR_OK)
                return SR_ERR;
 
+       key = tmpp = NULL;
        tmp_str2 = tmp_str;
        i = 0;
        while((p = strtok_r(tmp_str2, ",", &tmpp))) {
@@ -528,6 +529,9 @@ SR_PRIV int lecroy_xstream_init_device(struct sr_dev_inst *sdi)
        if (!(devc->model_state = scope_state_new(devc->model_config)))
                return SR_ERR_MALLOC;
 
+       /* Set the desired response mode. */
+       sr_scpi_send(sdi->conn, "COMM_HEADER OFF,WORD,BIN");
+
        return SR_OK;
 }