X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fhardware%2Fasix-omega-rtm-cli%2Fprotocol.h;h=b55f5f186304876ff43eac64ba4df5419ff7531d;hb=683f977e266eea4958839c561888f0f96c043ab6;hp=74f8b1bd0bf72f02c8804b16fb0cffbc1ed4d03b;hpb=13f6da6755cc93d779853ac008ed9c4bcd3045fb;p=libsigrok.git diff --git a/src/hardware/asix-omega-rtm-cli/protocol.h b/src/hardware/asix-omega-rtm-cli/protocol.h index 74f8b1bd..b55f5f18 100644 --- a/src/hardware/asix-omega-rtm-cli/protocol.h +++ b/src/hardware/asix-omega-rtm-cli/protocol.h @@ -20,16 +20,42 @@ #ifndef LIBSIGROK_HARDWARE_ASIX_OMEGA_RTM_CLI_PROTOCOL_H #define LIBSIGROK_HARDWARE_ASIX_OMEGA_RTM_CLI_PROTOCOL_H -#include #include #include +#include + #include "libsigrok-internal.h" #define LOG_PREFIX "asix-omega-rtm-cli" +#define RTMCLI_STDOUT_CHUNKSIZE (1024 * 1024) +#define FEED_QUEUE_DEPTH (256 * 1024) + struct dev_context { + char **channel_names; + struct sr_sw_limits limits; + struct { + gchar **argv; + GSpawnFlags flags; + gboolean running; + GPid pid; + gint fd_stdin_write; + gint fd_stdout_read; + } child; + struct { + uint8_t buff[RTMCLI_STDOUT_CHUNKSIZE]; + size_t fill; + } rawdata; + struct { + struct feed_queue_logic *queue; + uint8_t last_sample[sizeof(uint16_t)]; + uint64_t remain_count; + gboolean check_count; + } samples; }; -SR_PRIV int asix_omega_rtm_cli_receive_data(int fd, int revents, void *cb_data); +SR_PRIV int omega_rtm_cli_open(const struct sr_dev_inst *sdi); +SR_PRIV int omega_rtm_cli_close(const struct sr_dev_inst *sdi); +SR_PRIV int omega_rtm_cli_receive_data(int fd, int revents, void *cb_data); #endif