]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/testo/protocol.c
Build: Include <config.h> first in all source files
[libsigrok.git] / src / hardware / testo / protocol.c
index 1505e5bc9b4ebbbe2dbceabf036b789dba5f3068..9af799c5fcc471f72b21895b53637af77ce98412 100644 (file)
@@ -17,6 +17,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <config.h>
 #include <string.h>
 #include "protocol.h"
 
@@ -51,7 +52,6 @@ SR_PRIV int testo_set_serial_params(struct sr_usb_dev_inst *usb)
        return SR_OK;
 }
 
-
 /* Due to the modular nature of the Testo hardware, you can't assume
  * which measurements the device will supply. Fetch a single result
  * set synchronously to see which measurements it has. */
@@ -77,12 +77,12 @@ SR_PRIV int testo_probe_channels(struct sr_dev_inst *sdi)
                libusb_bulk_transfer(usb->devhdl, EP_IN, buf, MAX_REPLY_SIZE, &len, 10);
        } while (len > 2);
 
-       if (libusb_bulk_transfer(usb->devhdl, EP_OUT, devc->model->request,
+       if (libusb_bulk_transfer(usb->devhdl, EP_OUT, (unsigned char *)devc->model->request,
                        devc->model->request_size, &devc->reply_size, 10) < 0)
                return SR_ERR;
 
        packet_len = 0;
-       while(TRUE) {
+       while (TRUE) {
                if (libusb_bulk_transfer(usb->devhdl, EP_IN, buf, MAX_REPLY_SIZE,
                                &len, 250) < 0)
                        return SR_ERR;
@@ -154,7 +154,7 @@ SR_PRIV int testo_request_packet(const struct sr_dev_inst *sdi)
        usb = sdi->conn;
 
        libusb_fill_bulk_transfer(devc->out_transfer, usb->devhdl, EP_OUT,
-                       devc->model->request, devc->model->request_size,
+                       (unsigned char *)devc->model->request, devc->model->request_size,
                        receive_transfer, (void *)sdi, 100);
        if ((ret = libusb_submit_transfer(devc->out_transfer) != 0)) {
                sr_err("Failed to request packet: %s.", libusb_error_name(ret));
@@ -289,4 +289,3 @@ SR_PRIV void testo_receive_packet(const struct sr_dev_inst *sdi)
                g_slist_free(analog.channels);
        }
 }
-