X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Funi-t-ut32x%2Fprotocol.c;h=7fd1a02aef393c2960f60b902d566a3d53d28515;hb=7ed808179f5542c903a476266c4b175a6f2a18a7;hp=1a910b3aa27b232fb84cbd4b0253c7fcfd2fd338;hpb=515ab0889ebde4b373d620044a1a98da37153056;p=libsigrok.git diff --git a/src/hardware/uni-t-ut32x/protocol.c b/src/hardware/uni-t-ut32x/protocol.c index 1a910b3a..7fd1a02a 100644 --- a/src/hardware/uni-t-ut32x/protocol.c +++ b/src/hardware/uni-t-ut32x/protocol.c @@ -17,6 +17,7 @@ * along with this program. If not, see . */ +#include #include #include #include "protocol.h" @@ -61,7 +62,7 @@ static void process_packet(struct sr_dev_inst *sdi) { struct dev_context *devc; struct sr_datafeed_packet packet; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; GString *spew; float temp; int i; @@ -88,7 +89,7 @@ static void process_packet(struct sr_dev_inst *sdi) is_valid = FALSE; if (is_valid) { - memset(&analog, 0, sizeof(struct sr_datafeed_analog)); + memset(&analog, 0, sizeof(struct sr_datafeed_analog_old)); analog.mq = SR_MQ_TEMPERATURE; analog.mqflags = 0; switch (devc->packet[5] - 0x30) { @@ -127,7 +128,7 @@ static void process_packet(struct sr_dev_inst *sdi) if (is_valid) { analog.num_samples = 1; analog.data = &temp; - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; sr_session_send(devc->cb_data, &packet); g_slist_free(analog.channels); @@ -145,7 +146,7 @@ static void process_packet(struct sr_dev_inst *sdi) } -SR_PRIV void uni_t_ut32x_receive_transfer(struct libusb_transfer *transfer) +SR_PRIV void LIBUSB_CALL uni_t_ut32x_receive_transfer(struct libusb_transfer *transfer) { struct dev_context *devc; struct sr_dev_inst *sdi; @@ -207,7 +208,7 @@ SR_PRIV int uni_t_ut32x_handle_events(int fd, int revents, void *cb_data) return TRUE; di = sdi->driver; - drvc = di->priv; + drvc = di->context; if (!(devc = sdi->priv)) return TRUE;