devc = sdi->priv;
- sr_analog_init(&analog, &encoding, &meaning, &spec, 0);
+ /* TODO: Use proper 'digits' value for this device (and its modes). */
+ sr_analog_init(&analog, &encoding, &meaning, &spec, 2);
analog.num_samples = 1;
analog.meaning->mq = 0;
e++;
analog = g_malloc0(sizeof(struct sr_datafeed_analog));
- sr_analog_init(analog, &encoding, &meaning, &spec, 0);
+ /* TODO: Use proper 'digits' value for this device (and its modes). */
+ sr_analog_init(analog, &encoding, &meaning, &spec, 2);
analog->data = g_malloc(sizeof(float));
analog->meaning->channels = sdi->channels;
analog->num_samples = 1;
}
analog = g_malloc0(sizeof(struct sr_datafeed_analog));
- sr_analog_init(analog, &encoding, &meaning, &spec, 0);
+ /* TODO: Use proper 'digits' value for this device (and its modes). */
+ sr_analog_init(analog, &encoding, &meaning, &spec, 2);
analog->data = g_malloc(sizeof(float));
analog->meaning->channels = sdi->channels;
analog->num_samples = 1;
fvalue = 1.0;
}
- sr_analog_init(&analog, &encoding, &meaning, &spec, 0);
+ /* TODO: Use proper 'digits' value for this device (and its modes). */
+ sr_analog_init(&analog, &encoding, &meaning, &spec, 2);
analog.meaning->channels = sdi->channels;
analog.num_samples = 1;
analog.data = &fvalue;
encoding.is_signed = TRUE;
encoding.is_float = TRUE;
encoding.is_bigendian = FALSE;
- encoding.digits = 0;
+ /* TODO: Use proper 'digits' value for this device (and its modes). */
+ encoding.digits = 2;
encoding.is_digits_decimal = FALSE;
encoding.scale.p = 1;
encoding.scale.q = 1;
}
meaning.mqflags = 0;
meaning.channels = g_slist_append(NULL, ch);
- spec.spec_digits = 0;
+ /* TODO: Use proper 'digits' value for this device (and its modes). */
+ spec.spec_digits = 2;
packet.payload = &analog;
sr_session_send(sdi, &packet);
g_slist_free(meaning.channels);
/* Start decoding. */
value = 0.0;
scale = 1.0;
- sr_analog_init(&analog, &encoding, &meaning, &spec, 0);
+ /* TODO: Use proper 'digits' value for this device (and its modes). */
+ sr_analog_init(&analog, &encoding, &meaning, &spec, 2);
/*
* The numbers are hex digits, starting from 0.
packet.type = SR_DF_ANALOG;
packet.payload = &analog;
- sr_analog_init(&analog, &encoding, &meaning, &spec, 0);
+ /* TODO: Use proper 'digits' value for this device (and its modes). */
+ sr_analog_init(&analog, &encoding, &meaning, &spec, 2);
analog.num_samples = 1;
analog.meaning->mqflags = 0;
analog.data = &value;
g_array_append_val(float_data, voltage);
}
- sr_analog_init(&analog, &encoding, &meaning, &spec, 0);
+ /* TODO: Use proper 'digits' value for this device (and its modes). */
+ sr_analog_init(&analog, &encoding, &meaning, &spec, 2);
analog.meaning->channels = g_slist_append(NULL, ch);
analog.num_samples = float_data->len;
analog.data = (float*)float_data->data;
d += inc->unitsize;
}
- sr_analog_init(&analog, &encoding, &meaning, &spec, 0);
+ /* TODO: Use proper 'digits' value for this device (and its modes). */
+ sr_analog_init(&analog, &encoding, &meaning, &spec, 2);
packet.type = SR_DF_ANALOG;
packet.payload = &analog;
analog.num_samples = num_samples;
if (vdev->cur_analog_channel != 0) {
packet.type = SR_DF_ANALOG;
packet.payload = &analog;
- sr_analog_init(&analog, &encoding, &meaning, &spec, 0);
+ /* TODO: Use proper 'digits' value for this device (and its modes). */
+ sr_analog_init(&analog, &encoding, &meaning, &spec, 2);
analog.meaning->channels = g_slist_prepend(NULL,
g_array_index(vdev->analog_channels,
struct sr_channel *, vdev->cur_analog_channel - 1));