]> sigrok.org Git - libsigrok.git/blobdiff - hardware/rigol-ds/protocol.c
strutil: Add function to parse floating point numbers while ignoring the locale.
[libsigrok.git] / hardware / rigol-ds / protocol.c
index eefed0745b8f3e9276c71c7c93ac56458f70cddf..5ede6d7cab562e081226d65b622bca38a54c2f40 100644 (file)
@@ -423,7 +423,7 @@ SR_PRIV int rigol_ds_receive(int fd, int revents, void *cb_data)
 
        scpi = sdi->conn;
 
-       if (revents == G_IO_IN) {
+       if (revents == G_IO_IN || revents == 0) {
                if (devc->model->protocol == PROTOCOL_IEEE488_2) {
                        switch(devc->wait_event) {
                        case WAIT_NONE:
@@ -702,14 +702,14 @@ SR_PRIV int rigol_ds_get_dev_cfg(const struct sr_dev_inst *sdi)
        if (devc->model->has_digital) {
                sr_dbg("Current digital channel state:");
                for (i = 0; i < 16; i++) {
-                       cmd = g_strdup_printf(":DIG%d:TURN?", i + 1);
+                       cmd = g_strdup_printf(":DIG%d:TURN?", i);
                        res = get_cfg_string(sdi, cmd, &t_s);
                        g_free(cmd);
                        if (res != SR_OK)
                                return SR_ERR;
                        devc->digital_channels[i] = !strcmp(t_s, "ON") ? TRUE : FALSE;
                        g_free(t_s);
-                       sr_dbg("D%d: %s", i + 1, devc->digital_channels[i] ? "on" : "off");
+                       sr_dbg("D%d: %s", i, devc->digital_channels[i] ? "on" : "off");
                }
        }