+void update_scope_channel(struct scope *sc, int channel)
+{
+ struct channel_s *ch;
+ char cmd[128];
+ int offs;
+
+ if (channel == 1) {
+ ch = &(sc->status.channel.ch1);
+ strcpy(cmd, ":CHAN1:");
+ } else if (channel == 2) {
+ ch = &(sc->status.channel.ch2);
+ strcpy(cmd, ":CHAN2:");
+ } else {
+ fprintf(stderr, "Unknown channel %d!\n", channel);
+ return;
+ }
+
+ offs=strlen(cmd);
+
+ strcpy(cmd + offs, "BWL?"); ch->bwlimit_enabled = scope_get_truth_value(sc, cmd);
+ strcpy(cmd + offs, "COUP?"); COPY_SCOPE_STRING(sc, cmd, ch->coupling);
+ strcpy(cmd + offs, "DISP?"); ch->displayed = scope_get_truth_value(sc, cmd);
+ strcpy(cmd + offs, "INV?"); ch->inverted = scope_get_truth_value(sc, cmd);
+ strcpy(cmd + offs, "OFFS?"); ch->offset = scope_get_double(sc, cmd);
+ strcpy(cmd + offs, "PROB?"); ch->probe = scope_get_double(sc, cmd);
+ strcpy(cmd + offs, "SCAL?"); ch->scale = scope_get_double(sc, cmd);
+ strcpy(cmd + offs, "FILT?"); ch->filter_enabled = scope_get_truth_value(sc, cmd);
+ strcpy(cmd + offs, "MEMD?"); ch->memory_depth = scope_get_int(sc, cmd);
+ strcpy(cmd + offs, "VERN?"); COPY_SCOPE_STRING(sc, cmd, ch->vernier);
+}
+