3 * Copyright 2003,2006 Free Software Foundation, Inc.
5 * This file is part of GNU Radio
7 * GNU Radio is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3, or (at your option)
12 * GNU Radio is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with GNU Radio; see the file COPYING. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street,
20 * Boston, MA 02110-1301, USA.
23 #ifndef _FUSB_RA_WB_H_
24 #define _FUSB_RA_WB_H_
29 * \brief generic implementation of fusb_devhandle using only libusb
31 class fusb_devhandle_ra_wb : public fusb_devhandle
35 fusb_devhandle_ra_wb (usb_dev_handle *udh);
36 virtual ~fusb_devhandle_ra_wb ();
39 virtual fusb_ephandle *make_ephandle (int endpoint, bool input_p,
40 int block_size = 0, int nblocks = 0);
45 * \brief generic implementation of fusb_ephandle using only libusb
47 class fusb_ephandle_ra_wb : public fusb_ephandle
50 fusb_devhandle_ra_wb *d_devhandle;
55 fusb_ephandle_ra_wb (fusb_devhandle_ra_wb *dh, int endpoint, bool input_p,
56 int block_size = 0, int nblocks = 0);
57 virtual ~fusb_ephandle_ra_wb ();
61 virtual bool start (); //!< begin streaming i/o
62 virtual bool stop (); //!< stop streaming i/o
65 * \returns \p nbytes if write was successfully enqueued, else -1.
66 * Will block if no free buffers available.
68 virtual int write (const void *buffer, int nbytes);
71 * \returns number of bytes read or -1 if error.
72 * number of bytes read will be <= nbytes.
73 * Will block if no input available.
75 virtual int read (void *buffer, int nbytes);
78 * block until all outstanding writes have completed
80 virtual void wait_for_completion ();
83 #endif /* _FUSB_RA_WB_H_ */