X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=hardware%2Funi-t-dmm%2Fprotocol.c;h=a50b1a4214318f0352d10ee7fbd1e03f06aafb3b;hb=9a6517d14b1248855cde0d88ec9519f99184cc77;hp=55f573afdcb0e18e1216cf0c391016396f77bc21;hpb=35e199da505f5b8fadffa58875aaca70a8fde4f2;p=libsigrok.git diff --git a/hardware/uni-t-dmm/protocol.c b/hardware/uni-t-dmm/protocol.c index 55f573af..a50b1a42 100644 --- a/hardware/uni-t-dmm/protocol.c +++ b/hardware/uni-t-dmm/protocol.c @@ -66,17 +66,20 @@ * - ... */ -static void decode_packet(struct dev_context *devc, int dmm, const uint8_t *buf) +static void decode_packet(struct sr_dev_inst *sdi, int dmm, const uint8_t *buf) { struct sr_datafeed_packet packet; struct sr_datafeed_analog analog; + struct dev_context *devc; struct fs9721_info info; float floatval; int ret; + devc = sdi->priv; memset(&analog, 0, sizeof(struct sr_datafeed_analog)); /* Parse the protocol packet. */ + ret = SR_ERR; if (dmm == UNI_T_UT61D) ret = sr_dmm_parse_fs9922(buf, &floatval, &analog); else if (dmm == VOLTCRAFT_VC820) @@ -87,6 +90,7 @@ static void decode_packet(struct dev_context *devc, int dmm, const uint8_t *buf) } /* Send a sample packet with one analog value. */ + analog.probes = sdi->probes; analog.num_samples = 1; analog.data = &floatval; packet.type = SR_DF_ANALOG; @@ -254,11 +258,13 @@ static int uni_t_dmm_receive_data(int fd, int revents, int dmm, void *cb_data) if (data_byte_counter == NUM_DATA_BYTES) { log_dmm_packet(pbuf); data_byte_counter = 0; - if (!sr_fs9721_packet_valid(pbuf)) { - sr_err("Invalid packet."); - return TRUE; + if (dmm == VOLTCRAFT_VC820) { + if (!sr_fs9721_packet_valid(pbuf)) { + sr_err("Invalid packet."); + return TRUE; + } } - decode_packet(devc, dmm, pbuf); + decode_packet(sdi, dmm, pbuf); memset(pbuf, 0x00, NUM_DATA_BYTES); } }