]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/center-3xx/protocol.c
SR_DF_ANALOG_OLD and sr_datafeed_analog_old renames.
[libsigrok.git] / src / hardware / center-3xx / protocol.c
index 4cb1b95ae712848e4b2db448e5baea83a904832c..34478faeca681c1fcfa7020e179fd8d3b585ebf5 100644 (file)
@@ -18,6 +18,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
+#include <config.h>
 #include "protocol.h"
 
 #define NUM_CHANNELS 4
@@ -33,7 +34,8 @@ static int center_send(struct sr_serial_dev_inst *serial, const char *cmd)
 {
        int ret;
 
-       if ((ret = serial_write_blocking(serial, cmd, strlen(cmd), 0)) < 0) {
+       if ((ret = serial_write_blocking(serial, cmd, strlen(cmd),
+                       serial_timeout(serial, strlen(cmd)))) < 0) {
                sr_err("Error sending '%s' command: %d.", cmd, ret);
                return SR_ERR;
        }
@@ -121,7 +123,7 @@ static int packet_parse(const uint8_t *buf, int idx, struct center_info *info)
 static int handle_packet(const uint8_t *buf, struct sr_dev_inst *sdi, int idx)
 {
        struct sr_datafeed_packet packet;
-       struct sr_datafeed_analog analog;
+       struct sr_datafeed_analog_old analog;
        struct dev_context *devc;
        struct center_info info;
        GSList *l;
@@ -129,7 +131,7 @@ static int handle_packet(const uint8_t *buf, struct sr_dev_inst *sdi, int idx)
 
        devc = sdi->priv;
 
-       memset(&analog, 0, sizeof(struct sr_datafeed_analog));
+       memset(&analog, 0, sizeof(struct sr_datafeed_analog_old));
        memset(&info, 0, sizeof(struct center_info));
 
        ret = packet_parse(buf, idx, &info);
@@ -139,7 +141,7 @@ static int handle_packet(const uint8_t *buf, struct sr_dev_inst *sdi, int idx)
        }
 
        /* Common values for all 4 channels. */
-       packet.type = SR_DF_ANALOG;
+       packet.type = SR_DF_ANALOG_OLD;
        packet.payload = &analog;
        analog.mq = SR_MQ_TEMPERATURE;
        analog.unit = (info.celsius) ? SR_UNIT_CELSIUS : SR_UNIT_FAHRENHEIT;