summaryrefslogtreecommitdiffstats
path: root/lib/usrp/dboard/id.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-01-29 00:24:15 -0800
committerJosh Blum <josh@joshknows.com>2010-01-29 00:24:15 -0800
commit30a8d2ecc36ce8ad6c01032e514ac66a277f06d0 (patch)
tree894b16a38d02c677ab2038932838064edc325ab4 /lib/usrp/dboard/id.cpp
parentd5d9da3114bf069c05a8dcb7fca32ccd70405512 (diff)
downloaduhd-30a8d2ecc36ce8ad6c01032e514ac66a277f06d0.tar.gz
uhd-30a8d2ecc36ce8ad6c01032e514ac66a277f06d0.tar.bz2
uhd-30a8d2ecc36ce8ad6c01032e514ac66a277f06d0.zip
Added dboard id enum.
Moved timespec into its own header.
Diffstat (limited to 'lib/usrp/dboard/id.cpp')
-rw-r--r--lib/usrp/dboard/id.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/usrp/dboard/id.cpp b/lib/usrp/dboard/id.cpp
new file mode 100644
index 000000000..0aee3439e
--- /dev/null
+++ b/lib/usrp/dboard/id.cpp
@@ -0,0 +1,27 @@
+//
+// Copyright 2010 Ettus Research LLC
+//
+
+#include <usrp_uhd/usrp/dboard/id.hpp>
+#include <boost/assign/list_of.hpp>
+#include <boost/format.hpp>
+#include <map>
+
+using namespace usrp_uhd::usrp::dboard;
+
+std::ostream& operator<<(std::ostream &os, const dboard_id_t &id){
+ //map the dboard ids to string representations
+ std::map<dboard_id_t, std::string> id_to_str = boost::assign::map_list_of
+ (ID_BASIC_TX, "basic tx")
+ (ID_BASIC_RX, "basic rx")
+ ;
+
+ //get the string representation
+ if (id_to_str.count(id) != 0){
+ os << id_to_str[id];
+ }
+ else{
+ os << boost::format("dboard id %u") % unsigned(id);
+ }
+ return os;
+}