X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fmic-985xx%2Fprotocol.c;h=4ee11b70c8e3ce2e626570487e82db5298db0d9f;hb=9cfc695ffe5f04622f61acb98ea4ac91c3f4ffc3;hp=49f679802a31a2cfdf34da426ee8f163c8e24b8a;hpb=41caa31909882a34b88c8b8a844d555816b78453;p=libsigrok.git diff --git a/src/hardware/mic-985xx/protocol.c b/src/hardware/mic-985xx/protocol.c index 49f67980..4ee11b70 100644 --- a/src/hardware/mic-985xx/protocol.c +++ b/src/hardware/mic-985xx/protocol.c @@ -18,13 +18,15 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include "protocol.h" static int mic_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; } @@ -93,7 +95,7 @@ static int handle_packet(const uint8_t *buf, struct sr_dev_inst *sdi, int idx) { float temperature, humidity; struct sr_datafeed_packet packet; - struct sr_datafeed_analog2 analog; + struct sr_datafeed_analog analog; struct sr_analog_encoding encoding; struct sr_analog_meaning meaning; struct sr_analog_spec spec; @@ -114,7 +116,7 @@ static int handle_packet(const uint8_t *buf, struct sr_dev_inst *sdi, int idx) sr_analog_init(&analog, &encoding, &meaning, &spec, 3); /* Common values for both channels. */ - packet.type = SR_DF_ANALOG2; + packet.type = SR_DF_ANALOG; packet.payload = &analog; analog.num_samples = 1;