]> sigrok.org Git - libsigrok.git/commitdiff
rigol-dg: Handle unknown waveform types and abort gracefully
authorRalf <redacted>
Tue, 20 Oct 2020 18:19:03 +0000 (20:19 +0200)
committerSoeren Apel <redacted>
Sat, 28 Sep 2024 21:45:46 +0000 (23:45 +0200)
src/hardware/rigol-dg/protocol.c

index 47bf9446f48139aeba8d2698978d8f1f6a8f7532..0398135e58f53fc0faecab555db71d3ad4605d13 100644 (file)
@@ -122,8 +122,11 @@ SR_PRIV int rigol_dg_get_channel_state(const struct sr_dev_inst *sdi,
                        wf = WF_ARB;
                else if (g_ascii_strncasecmp(s, "DC", strlen("DC")) == 0)
                        wf = WF_DC;
-               else
+               else {
+                       sr_warn("Unknown waveform: %s\n", s);
+                       ret = SR_ERR;
                        goto done;
+               }
                ch_status->wf = wf;
                ch_status->wf_spec = rigol_dg_get_waveform_spec(
                                &devc->device->channels[ch->index], wf);