]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/motech-lps-30x/api.c
motech-lps-30x: Remove SERIAL_NONBLOCK.
[libsigrok.git] / src / hardware / motech-lps-30x / api.c
index 3778cc9b44ddcb4c87132095e13e257ccbb5b075..f0a0fd876a3b9ea6f471dcec8f9590d952b1e84c 100644 (file)
@@ -54,26 +54,26 @@ static const uint32_t devopts[] = {
        /* Device class */
        SR_CONF_POWER_SUPPLY,
        /* Aquisition modes. */
-       SR_CONF_LIMIT_SAMPLES,
-       SR_CONF_LIMIT_MSEC,
        SR_CONF_CONTINUOUS,
+       SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
+       SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET,
        /* Device configuration */
-       SR_CONF_OUTPUT_CHANNEL_CONFIG,
+       SR_CONF_OUTPUT_CHANNEL_CONFIG | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
 };
 
 /** Hardware capabilities channel 1, 2. */
 static const uint32_t devopts_ch12[] = {
-       SR_CONF_OUTPUT_VOLTAGE,
-       SR_CONF_OUTPUT_VOLTAGE_MAX,
-       SR_CONF_OUTPUT_CURRENT,
-       SR_CONF_OUTPUT_CURRENT_MAX,
-       SR_CONF_OUTPUT_ENABLED,
+       SR_CONF_OUTPUT_VOLTAGE | SR_CONF_GET,
+       SR_CONF_OUTPUT_VOLTAGE_MAX | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
+       SR_CONF_OUTPUT_CURRENT | SR_CONF_GET,
+       SR_CONF_OUTPUT_CURRENT_MAX | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
+       SR_CONF_OUTPUT_ENABLED | SR_CONF_GET | SR_CONF_SET,
 };
 
 /** Hardware capabilities channel 3. (LPS-304/305 only). */
 static const uint32_t devopts_ch3[] = {
-       SR_CONF_OUTPUT_VOLTAGE,
-       SR_CONF_OUTPUT_ENABLED,
+       SR_CONF_OUTPUT_VOLTAGE | SR_CONF_GET,
+       SR_CONF_OUTPUT_ENABLED | SR_CONF_GET | SR_CONF_SET,
 };
 
 static const char *channel_modes[] = {
@@ -146,7 +146,7 @@ SR_PRIV int lps_send_va(struct sr_serial_dev_inst *serial, const char* fmt, va_l
 
        sr_spew("lps_send_va: \"%s\"", buf);
 
-       retc = serial_write_nonblocking(serial, buf, strlen(buf));
+       retc = serial_write_blocking(serial, buf, strlen(buf));
 
        if (retc < 0)
                return SR_ERR;
@@ -399,7 +399,7 @@ static GSList *do_scan(lps_modelid modelid, struct sr_dev_driver *drv, GSList *o
        if (!(serial = sr_serial_dev_inst_new(conn, serialcomm)))
                return NULL;
 
-       if (serial_open(serial, SERIAL_RDWR | SERIAL_NONBLOCK) != SR_OK)
+       if (serial_open(serial, SERIAL_RDWR) != SR_OK)
                goto exit_err;
 
        /* Query and verify model string. */