X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fbeaglelogic%2Fprotocol.h;h=a2af44f2543be96e22c54f7b2810f6ff6410ed9f;hb=1e91a90f2ad5f915c2490c1f099f05e15277a365;hp=e058a60ab6560af593b1a8e83716f0ab5fa70dbc;hpb=695dc859c15ba4190f5c1aa2e1a6e2dc6a6e5845;p=libsigrok.git diff --git a/src/hardware/beaglelogic/protocol.h b/src/hardware/beaglelogic/protocol.h index e058a60a..a2af44f2 100644 --- a/src/hardware/beaglelogic/protocol.h +++ b/src/hardware/beaglelogic/protocol.h @@ -1,7 +1,7 @@ /* * This file is part of the libsigrok project. * - * Copyright (C) 2014 Kumar Abhishek + * Copyright (C) 2014-2017 Kumar Abhishek * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -32,12 +32,23 @@ #define SAMPLEUNIT_TO_BYTES(x) ((x) == 1 ? 1 : 2) +#define TCP_BUFFER_SIZE (128 * 1024) + /** Private, per-device-instance driver context. */ struct dev_context { - /* Model-specific information */ int max_channels; uint32_t fw_ver; + /* Operations */ + const struct beaglelogic_ops *beaglelogic; + + /* TCP Settings */ + char *address; + char *port; + int socket; + unsigned int read_timeout; + unsigned char *tcp_buffer; + /* Acquisition settings: see beaglelogic.h */ uint64_t cur_samplerate; uint64_t limit_samples; @@ -49,7 +60,6 @@ struct dev_context { uint32_t bufunitsize; uint32_t buffersize; - /* Operational state */ int fd; GPollFD pollfd; int last_error; @@ -64,6 +74,7 @@ struct dev_context { gboolean trigger_fired; }; -SR_PRIV int beaglelogic_receive_data(int fd, int revents, void *cb_data); +SR_PRIV int beaglelogic_native_receive_data(int fd, int revents, void *cb_data); +SR_PRIV int beaglelogic_tcp_receive_data(int fd, int revents, void *cb_data); #endif