22 #ifndef INCLUDED_IIO_DEVICE_SOURCE_IMPL_H 23 #define INCLUDED_IIO_DEVICE_SOURCE_IMPL_H 29 #include <boost/thread.hpp> 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);
static struct iio_context * get_context(const std::string &uri)
struct iio_device * dev
Definition: device_source_impl.h:62
static void set_params(struct iio_device *phy, const std::vector< std::string > ¶ms)
struct iio_context * ctx
Definition: device_source_impl.h:61
Definition: device_source_impl.h:41
<+description of block+>
Definition: device_source.h:43
#define DEFAULT_BUFFER_SIZE
Definition: device_sink.h:29
static std::vector< ctxInfo > contexts
Definition: device_source_impl.h:36
std::vector< struct iio_channel * > channel_list
Definition: device_source_impl.h:64
Definition: device_source_impl.h:35
bool destroy_ctx
Definition: device_source_impl.h:67
unsigned int buffer_size
Definition: device_source_impl.h:65
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
device_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)
Definition: attr_sink.h:29
std::vector< ctxInfo >::iterator ctx_it
Definition: device_source_impl.h:39
static void remove_ctx_history(struct iio_context *ctx, bool destroy_ctx)
struct iio_device * phy
Definition: device_source_impl.h:62
unsigned int decimation
Definition: device_source_impl.h:66
static bool load_fir_filter(std::string &filter, struct iio_device *phy)
void set_timeout_ms(unsigned long timeout)
void set_buffer_size(unsigned int buffer_size)
struct iio_buffer * buf
Definition: device_source_impl.h:63