Project

General

Profile

Bug #5144 ยป airspy_multi_dev.patch

yarda, 10/12/2021 08:52 PM

View differences:

lib/airspy/airspy_source_c.cc
95 95
    _vga_gain(0),
96 96
    _bandwidth(0)
97 97
{
98
  int ret;
99 98

  
99
  int ret;
100
  _dev = NULL;
100 101
  dict_t dict = params_to_dict(args);
101 102

  
102
  _dev = NULL;
103
  ret = airspy_open( &_dev );
103
  // the block below allows one to open airspy by serial number
104
  // 2016-Apr-5 - by Lawrence Glaister VE7IT  ve7it@shaw.ca
105
  // (allowing multiple airspy source blocks to be used) Note: each airspy should be
106
  // plugged into its own USB bus controller to support the high data rates involved.
107
  // osmocom Source block usage: Device arguments:  airspy=0x644064DC317C1FCD
108
  // if no device arguments are given or s/n=0, the first found airspy device will be used
109
  // use airspy_info utility to identify device serial number strings
110
  uint64_t sn = 0;
111
  std::stringstream ss;
112
  ss << std::hex << dict["airspy"];
113
  ss >> sn;
114
  std::cerr << "Attempting to open airspy by s/n= "
115
            <<  boost::format("0x%016X") % (sn) << std::endl;
116
  ret = airspy_open_sn( &_dev, sn );
104 117
  AIRSPY_THROW_ON_ERROR(ret, "Failed to open AirSpy device")
105 118

  
106 119
  uint8_t board_id;
......
111 124
  memset(version, 0, sizeof(version));
112 125
  ret = airspy_version_string_read( _dev, version, sizeof(version));
113 126
  AIRSPY_THROW_ON_ERROR(ret, "Failed to read version string")
114
#if 0
127

  
115 128
  airspy_read_partid_serialno_t part_serial;
116 129
  ret = airspy_board_partid_serialno_read( _dev, &part_serial );
117 130
  AIRSPY_THROW_ON_ERROR(ret, "Failed to read serial number")
118
#endif
131
  std::cerr << "Opened Device Serial Number=    "
132
    << boost::format("0x%08X") % (part_serial.serial_no[2])
133
    << boost::format("%08X")   % (part_serial.serial_no[3])
134
    << std::endl;
135

  
119 136
  uint32_t num_rates;
120 137
  airspy_get_samplerates(_dev, &num_rates, 0);
121 138
  uint32_t *samplerates = (uint32_t *) malloc(num_rates * sizeof(uint32_t));
    (1-1/1)
    Add picture from clipboard (Maximum size: 48.8 MB)