X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=blobdiff_plain;f=src%2Flibsigrok-internal.h;h=9a34ba169a84863e0dffb382d2c0688c27ec724a;hp=fcb0527a22f43f5473594052d1a79cf44b7d88b5;hb=d47872480164724f348ceedc8af2f39fc2e9fce4;hpb=2fba14d05a9dd65fc873b59c438f62b87ab5e2d9 diff --git a/src/libsigrok-internal.h b/src/libsigrok-internal.h index fcb0527a..9a34ba16 100644 --- a/src/libsigrok-internal.h +++ b/src/libsigrok-internal.h @@ -732,6 +732,8 @@ struct sr_serial_dev_inst; struct ser_lib_functions; struct ser_hid_chip_functions; struct sr_bt_desc; +typedef void (*serial_rx_chunk_callback)(struct sr_serial_dev_inst *serial, + void *cb_data, const void *buf, size_t count); struct sr_serial_dev_inst { /** Port name, e.g. '/dev/tty42'. */ char *port; @@ -745,6 +747,8 @@ struct sr_serial_dev_inst { int stop_bits; } comm_params; GString *rcv_buffer; + serial_rx_chunk_callback rx_chunk_cb_func; + void *rx_chunk_cb_data; #ifdef HAVE_LIBSERIALPORT /** libserialport port handle */ struct sp_port *sp_data; @@ -1159,6 +1163,8 @@ SR_PRIV int serial_read_blocking(struct sr_serial_dev_inst *serial, void *buf, size_t count, unsigned int timeout_ms); SR_PRIV int serial_read_nonblocking(struct sr_serial_dev_inst *serial, void *buf, size_t count); +SR_PRIV int serial_set_read_chunk_cb(struct sr_serial_dev_inst *serial, + serial_rx_chunk_callback cb, void *cb_data); SR_PRIV int serial_set_params(struct sr_serial_dev_inst *serial, int baudrate, int bits, int parity, int stopbits, int flowcontrol, int rts, int dtr); SR_PRIV int serial_set_paramstr(struct sr_serial_dev_inst *serial,