22 #ifndef INCLUDED_IIO_EIGHTBIT_SOURCE_IMPL_H 23 #define INCLUDED_IIO_EIGHTBIT_SOURCE_IMPL_H 29 #include <boost/thread.hpp> 35 struct ctxInfo{std::string
uri;
struct iio_context *
ctx;
int count;};
39 typedef std::vector<ctxInfo>::iterator
ctx_it;
44 void channel_read(
const struct iio_channel *chn,
45 void *dst,
size_t len);
47 boost::mutex iio_mutex;
48 boost::condition_variable iio_cond, iio_cond2;
49 unsigned long items_in_buffer;
51 volatile bool please_refill_buffer, thread_stopped;
54 boost::thread refill_thd;
56 unsigned long timeout;
61 struct iio_context *
ctx;
63 struct iio_buffer *
buf;
71 const std::string &device,
72 const std::vector<std::string> &channels,
73 const std::string &device_phy,
74 const std::vector<std::string> ¶ms,
80 const std::vector<std::string> ¶ms);
82 void set_params(
const std::vector<std::string> ¶ms);
87 int work(
int noutput_items,
88 gr_vector_const_void_star &input_items,
89 gr_vector_void_star &output_items);
96 static struct iio_context *
get_context(
const std::string &uri);
struct iio_context * ctx
Definition: eightbit_source_impl.h:61
bool destroy_ctx
Definition: eightbit_source_impl.h:67
void set_timeout_ms(unsigned long timeout)
#define DEFAULT_BUFFER_SIZE
Definition: device_sink.h:29
std::vector< struct iio_channel * > channel_list
Definition: eightbit_source_impl.h:64
static std::vector< ctxInfo > contexts
Definition: device_source_impl.h:36
struct iio_device * phy
Definition: eightbit_source_impl.h:62
static boost::mutex ctx_mutex
Definition: device_source_impl.h:37
int count
Definition: device_source_impl.h:35
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
std::string uri
Definition: device_source_impl.h:35
struct iio_context * ctx
Definition: device_source_impl.h:35
Definition: attr_sink.h:29
std::vector< ctxInfo >::iterator ctx_it
Definition: device_source_impl.h:39
Definition: eightbit_source_impl.h:41
static bool load_fir_filter(std::string &filter, struct iio_device *phy)
<+description of block+>
Definition: eightbit_source.h:43
unsigned int decimation
Definition: eightbit_source_impl.h:66
static void set_params(struct iio_device *phy, const std::vector< std::string > ¶ms)
eightbit_source_impl(struct iio_context *ctx, bool destroy_ctx, const std::string &device, const std::vector< std::string > &channels, const std::string &device_phy, const std::vector< std::string > ¶ms, unsigned int buffer_size=DEFAULT_BUFFER_SIZE, unsigned int decimation=0)
struct iio_device * dev
Definition: eightbit_source_impl.h:62
void set_buffer_size(unsigned int buffer_size)
static void remove_ctx_history(struct iio_context *ctx, bool destroy_ctx)
static struct iio_context * get_context(const std::string &uri)
struct iio_buffer * buf
Definition: eightbit_source_impl.h:63
unsigned int buffer_size
Definition: eightbit_source_impl.h:65