コード例 #1
0
ファイル: usrp1_impl.cpp プロジェクト: sunila/airblue_7dec12
 BOOST_FOREACH(usb_device_handle::sptr handle, usb_device_handle::get_device_list(vid, pid)) {
     usrp1_iface::sptr iface = usrp1_iface::make(usrp_ctrl::make(usb_control::make(handle)));
     device_addr_t new_addr;
     new_addr["type"] = "usrp1";
     new_addr["name"] = iface->mb_eeprom["name"];
     new_addr["serial"] = handle->get_serial();
     //this is a found usrp1 when the hint serial and name match or blank
     if (
         (not hint.has_key("name")   or hint["name"]   == new_addr["name"]) and
         (not hint.has_key("serial") or hint["serial"] == new_addr["serial"])
     ){
         usrp1_addrs.push_back(new_addr);
     }
 }
コード例 #2
0
ファイル: usrp1_impl.cpp プロジェクト: hadmack/UHD-Mirror
    BOOST_FOREACH(usb_device_handle::sptr handle, usb_device_handle::get_device_list(vid, pid)) {
        usb_control::sptr control;
        try {
            control = usb_control::make(handle, 0);
        }
        catch(const uhd::exception &) {
            continue;   //ignore claimed
        }

        fx2_ctrl::sptr fx2_ctrl = fx2_ctrl::make(control);
        const mboard_eeprom_t mb_eeprom(*fx2_ctrl, mboard_eeprom_t::MAP_B000);
        device_addr_t new_addr;
        new_addr["type"] = "usrp1";
        new_addr["name"] = mb_eeprom["name"];
        new_addr["serial"] = handle->get_serial();
        //this is a found usrp1 when the hint serial and name match or blank
        if (
            (not hint.has_key("name")   or hint["name"]   == new_addr["name"]) and
            (not hint.has_key("serial") or hint["serial"] == new_addr["serial"])
        ) {
            usrp1_addrs.push_back(new_addr);
        }
    }