]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/serial-dmm/protocol.h
serial-dmm: sort the list of device drivers (part 6, fs9922)
[libsigrok.git] / src / hardware / serial-dmm / protocol.h
index 1a0b5939a5fe786ab91a7a8e53e3037144b36303..9749345604589328e7b619b3e0f55b39cf145ca5 100644 (file)
@@ -26,20 +26,24 @@ struct dmm_info {
        /** libsigrok driver info struct. */
        struct sr_dev_driver di;
        /** Manufacturer/brand. */
-       char *vendor;
+       const char *vendor;
        /** Model. */
-       char *device;
+       const char *device;
        /** serialconn string. */
-       char *conn;
+       const char *conn;
        /** Baud rate. */
        uint32_t baudrate;
        /** Packet size in bytes. */
        int packet_size;
-       /** Request timeout [ms] before request is considered lost and a new
-        *  one is sent. Used only if device needs polling. */
+       /**
+        * Request timeout [ms] before request is considered lost and a new
+        * one is sent. Used only if device needs polling.
+        */
        int64_t req_timeout_ms;
-       /** Delay between reception of packet and next request. Some DMMs
-        *  need this. Used only if device needs polling. */
+       /**
+        * Delay between reception of packet and next request. Some DMMs
+        * need this. Used only if device needs polling.
+        */
        int64_t req_delay_ms;
        /** Packet request function. */
        int (*packet_request)(struct sr_serial_dev_inst *);
@@ -47,9 +51,9 @@ struct dmm_info {
        gboolean (*packet_valid)(const uint8_t *);
        /** Packet parsing function. */
        int (*packet_parse)(const uint8_t *, float *,
-                           struct sr_datafeed_analog_old *, void *);
+                           struct sr_datafeed_analog *, void *);
        /** */
-       void (*dmm_details)(struct sr_datafeed_analog_old *, void *);
+       void (*dmm_details)(struct sr_datafeed_analog *, void *);
        /** Size of chipset info struct. */
        gsize info_size;
 };
@@ -58,27 +62,16 @@ struct dmm_info {
 
 /** Private, per-device-instance driver context. */
 struct dev_context {
-       /** The current sampling limit (in number of samples). */
-       uint64_t limit_samples;
-
-       /** The time limit (in milliseconds). */
-       uint64_t limit_msec;
-
-       /** Opaque pointer passed in by the frontend. */
-       void *cb_data;
-
-       /** The current number of already received samples. */
-       uint64_t num_samples;
-
-       /** The starting time of current sampling run. */
-       int64_t starttime;
+       struct sr_sw_limits limits;
 
        uint8_t buf[DMM_BUFSIZE];
        int bufoffset;
        int buflen;
 
-       /** The timestamp [µs] to send the next request.
-        *  Used only if device needs polling. */
+       /**
+        * The timestamp [µs] to send the next request.
+        * Used only if device needs polling.
+        */
        int64_t req_next_at;
 };