X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Ftesto%2Fprotocol.h;h=654eb6977a7fabbb5d4fc591ae60f351f5dfa681;hb=55fb76b34826a287240bebeeda688e4c465b4751;hp=f61fe2d4b201e4c9faf201b0cd80da15004b634a;hpb=155b680da482cea2381becb73c51cfb838bff31e;p=libsigrok.git diff --git a/src/hardware/testo/protocol.h b/src/hardware/testo/protocol.h index f61fe2d4..654eb697 100644 --- a/src/hardware/testo/protocol.h +++ b/src/hardware/testo/protocol.h @@ -22,7 +22,7 @@ #include #include -#include "libsigrok.h" +#include #include "libsigrok-internal.h" #define LOG_PREFIX "testo" @@ -46,38 +46,35 @@ #define EP_OUT 2 | LIBUSB_ENDPOINT_OUT struct testo_model { - char *name; + const char *name; int request_size; - unsigned char *request; + const uint8_t *request; }; /** Private, per-device-instance driver context. */ struct dev_context { /* Model-specific information */ - struct testo_model *model; + const struct testo_model *model; /* Acquisition settings */ - uint64_t limit_msec; - uint64_t limit_samples; - void *cb_data; + struct sr_sw_limits sw_limits; /* Operational state */ - gint64 end_time; - uint64_t num_samples; uint8_t channel_units[MAX_CHANNELS]; int num_channels; /* Temporary state across callbacks */ struct libusb_transfer *out_transfer; - unsigned char reply[MAX_REPLY_SIZE]; + uint8_t reply[MAX_REPLY_SIZE]; int reply_size; }; SR_PRIV int testo_set_serial_params(struct sr_usb_dev_inst *usb); SR_PRIV int testo_probe_channels(struct sr_dev_inst *sdi); -SR_PRIV void receive_transfer(struct libusb_transfer *transfer); +SR_PRIV void LIBUSB_CALL receive_transfer(struct libusb_transfer *transfer); SR_PRIV int testo_request_packet(const struct sr_dev_inst *sdi); -SR_PRIV gboolean testo_check_packet_prefix(unsigned char *buf, int len); +SR_PRIV gboolean testo_check_packet_prefix(uint8_t *buf, int len); SR_PRIV uint16_t crc16_mcrf4xx(uint16_t crc, uint8_t *data, size_t len); SR_PRIV void testo_receive_packet(const struct sr_dev_inst *sdi); + #endif