X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fmic-985xx%2Fprotocol.c;h=4ee11b70c8e3ce2e626570487e82db5298db0d9f;hb=32ba0d80054df01767ec323c621ab1c6bc5f310c;hp=9e3d9863b3bbc1aa16392c920e8c6b68a041e448;hpb=6ec6c43b4738dbc7091f4a49a4ec80ea6102cb52;p=libsigrok.git diff --git a/src/hardware/mic-985xx/protocol.c b/src/hardware/mic-985xx/protocol.c index 9e3d9863..4ee11b70 100644 --- a/src/hardware/mic-985xx/protocol.c +++ b/src/hardware/mic-985xx/protocol.c @@ -25,7 +25,8 @@ 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; } @@ -94,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; @@ -115,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;