Skip to content

Commit 20a083f

Browse files
committed
gr-uhd: get_usrp_info has help info and can only be called with a recent enough version of UHD
1 parent c5ad101 commit 20a083f

6 files changed

+25
-13
lines changed

gr-uhd/include/gr_uhd_usrp_sink.h

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2010-2011 Free Software Foundation, Inc.
2+
* Copyright 2010-2012 Free Software Foundation, Inc.
33
*
44
* This file is part of GNU Radio
55
*
@@ -130,7 +130,13 @@ class GR_UHD_API uhd_usrp_sink : virtual public gr_sync_block{
130130
*/
131131
virtual void set_start_time(const uhd::time_spec_t &time) = 0;
132132

133-
virtual std::vector<std::string> list_property_tree(const std::string &path) = 0;
133+
/*!
134+
* Returns identifying information about this USRP's configuration.
135+
* Returns motherboard ID and serial.
136+
* Returns daughterboard TX/RX ID, subdev name, and serial.
137+
* \param mboard the motherboard index 0 to M-1
138+
* \param chan channel index 0 to N-1
139+
*/
134140
virtual uhd::dict<std::string, std::string> get_usrp_info(size_t mboard = 0, size_t chan = 0) = 0;
135141

136142
/*!

gr-uhd/include/gr_uhd_usrp_source.h

+7-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,13 @@ class GR_UHD_API uhd_usrp_source : virtual public gr_sync_block{
122122
*/
123123
virtual void set_start_time(const uhd::time_spec_t &time) = 0;
124124

125-
virtual std::vector<std::string> list_property_tree(const std::string &path) = 0;
125+
/*!
126+
* Returns identifying information about this USRP's configuration.
127+
* Returns motherboard ID and serial.
128+
* Returns daughterboard TX/RX ID, subdev name, and serial.
129+
* \param mboard the motherboard index 0 to M-1
130+
* \param chan channel index 0 to N-1
131+
*/
126132
virtual uhd::dict<std::string, std::string> get_usrp_info(size_t mboard = 0, size_t chan = 0) = 0;
127133

128134
/*!

gr-uhd/lib/gr_uhd_usrp_sink.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ class uhd_usrp_sink_impl : public uhd_usrp_sink{
6666
_dev = uhd::usrp::multi_usrp::make(device_addr);
6767
}
6868

69-
std::vector<std::string> list_property_tree(const std::string &path){
70-
return _dev->list_property_tree(path);
71-
}
72-
7369
uhd::dict<std::string, std::string> get_usrp_info(size_t mboard, size_t chan){
70+
#ifdef UHD_USRP_MULTI_USRP_GET_USRP_INFO_API
7471
return _dev->get_usrp_info(mboard, chan);
72+
#else
73+
throw std::runtime_error("not implemented in this version");
74+
#endif
7575
}
7676

7777
void set_subdev_spec(const std::string &spec, size_t mboard){

gr-uhd/lib/gr_uhd_usrp_source.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ class uhd_usrp_source_impl : public uhd_usrp_source{
7070
_dev = uhd::usrp::multi_usrp::make(device_addr);
7171
}
7272

73-
std::vector<std::string> list_property_tree(const std::string &path){
74-
return _dev->list_property_tree(path);
75-
}
76-
7773
uhd::dict<std::string, std::string> get_usrp_info(size_t mboard, size_t chan){
74+
#ifdef UHD_USRP_MULTI_USRP_GET_USRP_INFO_API
7875
return _dev->get_usrp_info(mboard, chan);
76+
#else
77+
throw std::runtime_error("not implemented in this version");
78+
#endif
7979
}
8080

8181
void set_subdev_spec(const std::string &spec, size_t mboard){

gr-uhd/swig/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright 2010-2011 Free Software Foundation, Inc.
2+
# Copyright 2010-2012 Free Software Foundation, Inc.
33
#
44
# This file is part of GNU Radio
55
#

gr-uhd/swig/uhd_swig.i

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- c++ -*- */
22
/*
3-
* Copyright 2010-2011 Free Software Foundation, Inc.
3+
* Copyright 2010-2012 Free Software Foundation, Inc.
44
*
55
* This file is part of GNU Radio
66
*

0 commit comments

Comments
 (0)