summaryrefslogtreecommitdiffstats
path: root/include/usrp_uhd.hpp
blob: 1cbd064b71addc21f9379459158d4a8d4f66ef36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
// Copyright 2010 Ettus Research LLC
//

#ifndef INCLUDED_USRP_UHD_HPP
#define INCLUDED_USRP_UHD_HPP

#include <usrp_uhd/device_addr.hpp>
#include <usrp_uhd/wax.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/function.hpp>
#include <vector>
#include <sys/uio.h>

namespace usrp_uhd{

    class usrp_uhd{

    public:
        typedef boost::shared_ptr<usrp_uhd> sptr;
        typedef boost::function<bool(void *data, size_t len)> recv_hdlr_t;
        usrp_uhd(device_addr_t device_addr);
        ~usrp_uhd(void);

        //the io interface
        void send(const std::vector<iovec> &iovs);
        void send(void* data, size_t len); //wrapper
        void recv(const recv_hdlr_t &recv_hdlr);
        void recv(void* &data, size_t &len); //wrapper

        //connect dsps and subdevs
        void connect(const wax::type &src, const wax::type &sink);

        //the properties interface
        wax::proxy props(void);

    private:
        wax::type d_mboard;
    };

} //namespace usrp_uhd

#endif /* INCLUDED_USRP_UHD_HPP */