X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Flibsigrok-internal.h;h=a937d046ff8854399bae7111b471ca8741acf797;hb=62d7945f8059ccbf56dfa2e5eb60671dd5bc959b;hp=4b3daf441151c9d5ed1cfef08c83a4855febc77d;hpb=5a1afc0907abfee5848484f944789213d6be9752;p=libsigrok.git diff --git a/src/libsigrok-internal.h b/src/libsigrok-internal.h index 4b3daf44..a937d046 100644 --- a/src/libsigrok-internal.h +++ b/src/libsigrok-internal.h @@ -632,6 +632,8 @@ enum { SR_PRIV struct sr_channel *sr_channel_new(struct sr_dev_inst *sdi, int index, int type, gboolean enabled, const char *name); +SR_PRIV struct sr_channel *sr_next_enabled_channel(const struct sr_dev_inst *sdi, + struct sr_channel *cur_channel); /** Device instance data */ struct sr_dev_inst { @@ -716,7 +718,7 @@ struct sr_session { GSList *datafeed_callbacks; GSList *transforms; struct sr_trigger *trigger; - GTimeVal starttime; + gboolean running; unsigned int num_sources; @@ -729,7 +731,6 @@ struct sr_session { */ struct source *sources; GPollFD *pollfds; - int source_timeout; /* * These are our synchronization primitives for stopping the session in @@ -742,6 +743,9 @@ struct sr_session { gboolean abort_session; }; +SR_PRIV int sr_session_source_add_internal(struct sr_session *session, + GPollFD *pollfd, int timeout, sr_receive_data_callback cb, + void *cb_data, gintptr poll_object, gboolean is_usb); SR_PRIV int sr_session_send(const struct sr_dev_inst *sdi, const struct sr_datafeed_packet *packet); SR_PRIV int sr_session_stop_sync(struct sr_session *session); @@ -866,6 +870,7 @@ SR_PRIV int ezusb_upload_firmware(libusb_device *dev, int configuration, #ifdef HAVE_LIBUSB_1_0 SR_PRIV GSList *sr_usb_find(libusb_context *usb_ctx, const char *conn); SR_PRIV int sr_usb_open(libusb_context *usb_ctx, struct sr_usb_dev_inst *usb); +SR_PRIV void sr_usb_close(struct sr_usb_dev_inst *usb); SR_PRIV int usb_source_add(struct sr_session *session, struct sr_context *ctx, int timeout, sr_receive_data_callback cb, void *cb_data); SR_PRIV int usb_source_remove(struct sr_session *session, struct sr_context *ctx); @@ -1126,4 +1131,17 @@ SR_PRIV gboolean sr_ut372_packet_valid(const uint8_t *buf); SR_PRIV int sr_ut372_parse(const uint8_t *buf, float *floatval, struct sr_datafeed_analog *analog, void *info); +/*--- hardware/scale/kern.c -------------------------------------------------*/ + +struct kern_info { + gboolean is_gram, is_carat, is_ounce, is_pound, is_troy_ounce; + gboolean is_pennyweight, is_grain, is_tael, is_momme, is_tola; + gboolean is_percentage, is_piece, is_unstable, is_stable, is_error; + int buflen; +}; + +SR_PRIV gboolean sr_kern_packet_valid(const uint8_t *buf); +SR_PRIV int sr_kern_parse(const uint8_t *buf, float *floatval, + struct sr_datafeed_analog *analog, void *info); + #endif