Changeset 9459
- Timestamp:
- 08/30/08 12:22:11
- Files:
-
- usrp2/trunk/host/lib/usrp2.cc (modified) (2 diffs)
- usrp2/trunk/host/lib/usrp2_impl.cc (modified) (3 diffs)
- usrp2/trunk/host/lib/usrp2_impl.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
usrp2/trunk/host/lib/usrp2.cc
r9455 r9459 127 127 128 128 props_vector_t u2s = find(ifc, naddr); 129 if (u2s.size() != 1) 130 throw std::runtime_error("Unable to find requested USRP2."); 129 int n = u2s.size(); 130 131 if (n == 0) { 132 if (addr == "") 133 throw std::runtime_error("No USRPs found on interface."); 134 else 135 throw std::runtime_error("Specified USRP2 not found on interface."); 136 } 137 138 if (n > 1) 139 throw std::runtime_error("Multiple USRPs found on interface; must select by MAC address."); 131 140 132 141 return find_existing_or_make_new(ifc, &u2s[0]); … … 135 144 // Private constructor. Sole function is to create an impl. 136 145 usrp2::usrp2(const std::string &ifc, props *p) 137 : d_impl(new usrp2::impl(ifc, p ->addr))146 : d_impl(new usrp2::impl(ifc, p)) 138 147 { 139 148 // NOP usrp2/trunk/host/lib/usrp2_impl.cc
r9409 r9459 119 119 120 120 121 usrp2::impl::impl(const std::string &ifc, const std::string &addr)121 usrp2::impl::impl(const std::string &ifc, props *p) 122 122 : d_eth_buf(new eth_buffer()), d_pf(0), d_bg_thread(0), d_bg_running(false), 123 123 d_rx_decim(0), d_rx_seqno(-1), d_tx_seqno(0), d_next_rid(0), … … 126 126 d_channel_rings(NCHANS) 127 127 { 128 props_vector_t u2s = find(ifc, addr);129 if (u2s.size() != 1)130 throw std::runtime_error("Unable to find requested USRP2.");131 132 128 if (!d_eth_buf->open(ifc, htons(U2_ETHERTYPE))) 133 129 throw std::runtime_error("Unable to register USRP2 protocol"); … … 137 133 throw std::runtime_error("Unable to attach packet filter."); 138 134 139 d_addr = u2s[0].addr;135 d_addr = p->addr; 140 136 141 137 if (USRP2_IMPL_DEBUG) usrp2/trunk/host/lib/usrp2_impl.h
r9455 r9459 90 90 91 91 public: 92 impl(const std::string &ifc, const std::string &addr);92 impl(const std::string &ifc, props *p); 93 93 ~impl(); 94 94
