X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fkern-scale%2Fprotocol.h;h=7566ea5b291e2b769fef89332108de07a572383e;hb=3f8453b274d7776ff4f0bb7a869eb6211364c190;hp=fe8ae8db9d93328229dea9f754c7550495c399bb;hpb=695dc859c15ba4190f5c1aa2e1a6e2dc6a6e5845;p=libsigrok.git diff --git a/src/hardware/kern-scale/protocol.h b/src/hardware/kern-scale/protocol.h index fe8ae8db..7566ea5b 100644 --- a/src/hardware/kern-scale/protocol.h +++ b/src/hardware/kern-scale/protocol.h @@ -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 . */ #ifndef LIBSIGROK_HARDWARE_KERN_SCALE_PROTOCOL_H @@ -32,34 +31,21 @@ struct scale_info { const char *device; /** serialconn string. */ const char *conn; - /** Baud rate. */ - uint32_t baudrate; /** Packet size in bytes. */ int packet_size; /** Packet validation function. */ 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; - - /** 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;