X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Fhardware%2Fkern-scale%2Fprotocol.h;h=836eb91b0404014ac7670cae80467f656743271c;hb=9e0693f92d9e11ac7bc75ef4d7ee082cae99ab6c;hp=1a7a51a4c578da1c89e6f74941299a3a483ec95d;hpb=9380ec2f05e67518b1b23057749df3684a0cf05e;p=libsigrok.git
diff --git a/src/hardware/kern-scale/protocol.h b/src/hardware/kern-scale/protocol.h
index 1a7a51a4..836eb91b 100644
--- a/src/hardware/kern-scale/protocol.h
+++ b/src/hardware/kern-scale/protocol.h
@@ -14,22 +14,44 @@
* 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
#define LIBSIGROK_HARDWARE_KERN_SCALE_PROTOCOL_H
-#include
-#include
-#include
-#include "libsigrok-internal.h"
-
#define LOG_PREFIX "kern-scale"
-/** Private, per-device-instance driver context. */
+struct scale_info {
+ /** libsigrok driver info struct. */
+ struct sr_dev_driver di;
+ /** Manufacturer/brand. */
+ const char *vendor;
+ /** Model. */
+ 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 *, void *);
+ /** Size of chipset info struct. */
+ gsize info_size;
+};
+
+#define SCALE_BUFSIZE 256
+
struct dev_context {
+ struct sr_sw_limits limits;
+
+ uint8_t buf[SCALE_BUFSIZE];
+ int bufoffset;
+ int buflen;
};
SR_PRIV int kern_scale_receive_data(int fd, int revents, void *cb_data);