+ scpi = sdi->conn;
+
+ /* Retrieve requested value for this state. */
+ if (sr_scpi_get_float(scpi, NULL, &f) == SR_OK) {
+ pch = devc->cur_channel->priv;
+ ch_spec = &devc->device->channels[pch->hw_output_idx];
+ packet.type = SR_DF_ANALOG;
+ packet.payload = &analog;
+ sr_analog_init(&analog, &encoding, &meaning, &spec, 0);
+ analog.meaning->channels = g_slist_append(NULL, devc->cur_channel);
+ analog.num_samples = 1;
+ analog.meaning->mq = pch->mq;
+ if (pch->mq == SR_MQ_VOLTAGE) {
+ analog.meaning->unit = SR_UNIT_VOLT;
+ analog.encoding->digits = ch_spec->voltage[4];
+ analog.spec->spec_digits = ch_spec->voltage[3];
+ } else if (pch->mq == SR_MQ_CURRENT) {
+ analog.meaning->unit = SR_UNIT_AMPERE;
+ analog.encoding->digits = ch_spec->current[4];
+ analog.spec->spec_digits = ch_spec->current[3];
+ } else if (pch->mq == SR_MQ_POWER) {
+ analog.meaning->unit = SR_UNIT_WATT;
+ analog.encoding->digits = ch_spec->power[4];
+ analog.spec->spec_digits = ch_spec->power[3];
+ }
+ analog.meaning->mqflags = SR_MQFLAG_DC;
+ analog.data = &f;
+ sr_session_send(sdi, &packet);
+ g_slist_free(analog.meaning->channels);
+ }
+
+ if (g_slist_length(sdi->channels) > 1) {
+ next_channel = sr_next_enabled_channel(sdi, devc->cur_channel);
+ if (select_channel(sdi, next_channel) != SR_OK) {
+ sr_err("Failed to select channel %s", next_channel->name);
+ return FALSE;
+ }