]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/kern-scale/protocol.h
Backport recent changes from mainline.
[libsigrok.git] / src / hardware / kern-scale / protocol.h
index 9be375f7b8867d69b9912c02f8bdf80ed78ad6b6..836eb91b0404014ac7670cae80467f656743271c 100644 (file)
@@ -14,8 +14,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
 #ifndef LIBSIGROK_HARDWARE_KERN_SCALE_PROTOCOL_H
@@ -27,11 +26,11 @@ struct scale_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. */
@@ -40,29 +39,15 @@ struct scale_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 *);
        /** Size of chipset info struct. */
        gsize info_size;
 };
 
 #define SCALE_BUFSIZE 256
 
-/** 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[SCALE_BUFSIZE];
        int bufoffset;