SR_CONF_CURRENT | SR_CONF_GET,
SR_CONF_CURRENT_LIMIT | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_ENABLED | SR_CONF_GET | SR_CONF_SET,
+ SR_CONF_REGULATION | SR_CONF_GET,
};
static const struct korad_kdxxxxp_model models[] = {
case SR_CONF_ENABLED:
*data = g_variant_new_boolean(devc->output_enabled);
break;
+ case SR_CONF_REGULATION:
+ /* Dual channel not supported. */
+ if (devc->cc_mode[0])
+ *data = g_variant_new_string("CC");
+ else
+ *data = g_variant_new_string("CV");
+ break;
default:
return SR_ERR_NA;
}
struct dev_context *devc)
{
double value;
- int count, ret;
+ int count, ret, i;
float *target;
char status_byte;
devc->reply[count] = 0;
if (target) {
+ /* Handle the strange 'M' */
+ if (devc->reply[0] == 'M') {
+ for (i = 1; i < count; ++i) {
+ devc->reply[i - 1] = devc->reply[i];
+ }
+ /* Get the last character */
+ if (( i = korad_kdxxxxp_read_chars(serial, 1,
+ &(devc->reply[count]))) < 0)
+ return i;
+ }
value = g_ascii_strtod(devc->reply, NULL);
*target = (float)value;
sr_dbg("value: %f",value);